Skip to content

wip

wip #8

Workflow file for this run

name: 简化版部署到阿里云 OSS
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: "18"
- name: 安装 pnpm
uses: pnpm/action-setup@v4
with:
version: latest
- name: 安装依赖并构建
run: |
pnpm install --no-frozen-lockfile
pnpm run build
- name: 安装阿里云 OSS CLI
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
shell: bash
run: |
echo "::group::Installing ossutil2"
curl -o ossutil.zip https://gosspublic.alicdn.com/ossutil/v2/2.1.1/ossutil-2.1.1-linux-amd64.zip
unzip -o ossutil.zip
chmod 755 ossutil-2.1.1-linux-amd64/ossutil
sudo mv ossutil-2.1.1-linux-amd64/ossutil /usr/local/bin/
rm -rf ossutil.zip ossutil-2.1.1-linux-amd64
echo "ossutil2 installation completed"
# Set the OSS configuration
ossutil config set Region oss-cn-beijing
ossutil config set endpoint oss-cn-beijing.aliyuncs.com
ossutil config set accessKeyID ${{ secrets.ALICLOUDOSS_KEY_ID }}
ossutil config set accessKeySecret ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
- name: Upload to Aliyun OSS
# if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main'
shell: bash
env:
OSSUTIL_ACCESS_KEY_ID: ${{ secrets.ALICLOUDOSS_KEY_ID }}
OSSUTIL_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUDOSS_KEY_SECRET }}
OSSUTIL_ENDPOINT: https://oss-cn-beijing.aliyuncs.com
run: |
echo "::group::Uploading files to OSS"
# Upload the artifact file to two different paths
ossutil cp .vitepress/dist "oss://rustfs-docs/" --force
echo "Successfully uploaded to OSS"