v3.20.1 #703
This file contains 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: site sync | |
on: | |
push: | |
branches: [main] | |
paths: | |
- .github/workflows/site.yml | |
- site/** | |
- CHANGELOG.md | |
# repository_dispatch: | |
# types: [update-hooks-docs] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: action-zip | |
uses: montudor/[email protected] | |
# 安装根目录依赖 | |
- name: Install root dependencies | |
run: npm install | |
# 构建根目录项目 | |
- name: Build root project | |
run: npm run build --if-present | |
# 安装和构建 site 目录 | |
- name: Install and build site | |
working-directory: site | |
run: | | |
npm install | |
npm run build | |
# 打包文档 | |
- name: Zip output | |
working-directory: site | |
run: zip -r build/document_archive.zip docs i18n blog versioned_docs versioned_sidebars | |
- name: upload files to OSS | |
uses: fangbinwei/aliyun-oss-website-action@v1 | |
with: | |
accessKeyId: ${{ secrets.DEPLOY_SITE_ACCESS_KEY_ID }} | |
accessKeySecret: ${{ secrets.DEPLOY_SITE_ACCESS_KEY_SECRET }} | |
bucket: midway-next-site-hk | |
# use your own endpoint | |
endpoint: oss-cn-hongkong.aliyuncs.com | |
folder: site/build |