rename #55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: | |
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: "22" | |
- 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" | |
- name: Upload to Aliyun OSS | |
# if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main' | |
shell: bash | |
env: | |
OSS_ACCESS_KEY_ID: ${{ secrets.ALICLOUDOSS_KEY_ID }} | |
OSS_ACCESS_KEY_SECRET: ${{ secrets.ALICLOUDOSS_KEY_SECRET }} | |
OSS_REGION: cn-beijing | |
OSS_ENDPOINT: https://oss-cn-beijing.aliyuncs.com | |
run: | | |
# clean before | |
ossutil rm -r oss://rustfs-docs/ --force --recursive | |
ossutil cp -r .vitepress/dist/ oss://rustfs-docs/ --force --recursive | |
echo "Successfully uploaded to OSS" | |
- name: Show OSS error log if exists | |
if: failure() | |
run: | | |
cat /home/runner/work/docs.rustfs.com/docs.rustfs.com/ossutil_output/*.report || true |