Skip to content

Commit 8941abb

Browse files
committed
docs: Synchronize v3 document changes
1 parent 71a1bda commit 8941abb

38 files changed

+2427
-436
lines changed

.github/workflows/beta_site.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/site.yml

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,54 @@
1-
name: site sync
1+
name: Deploy Site
22

33
on:
44
push:
5-
branches: [main]
5+
branches:
6+
- v4-next
67
paths:
78
- .github/workflows/site.yml
89
- site/**
910
- CHANGELOG.md
10-
# repository_dispatch:
11-
# types: [update-hooks-docs]
11+
# Review gh actions docs if you want to further define triggers, paths, etc
12+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
1213

1314
jobs:
1415
build:
15-
16-
runs-on: ubuntu-latest
17-
16+
name: Build Docusaurus
1817
strategy:
1918
matrix:
2019
node-version: [20.x]
20+
os: [ubuntu-latest]
21+
runs-on: ${{ matrix.os }}
2122

2223
steps:
2324
- uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
28+
- name: Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 9
32+
run_install: false
33+
2434
- name: Use Node.js ${{ matrix.node-version }}
2535
uses: actions/setup-node@v4
2636
with:
2737
node-version: ${{ matrix.node-version }}
28-
- name: action-zip
29-
uses: montudor/action-zip@v1.0.0
38+
cache: 'pnpm'
3039

31-
# 安装根目录依赖
3240
- name: Install root dependencies
33-
run: npm install
41+
run: pnpm install
3442

35-
# 构建根目录项目
3643
- name: Build root project
37-
run: npm run build --if-present
44+
run: pnpm run build --if-present
45+
46+
# site 目录使用 npm,需要单独配置 npm 缓存
47+
- uses: actions/setup-node@v4
48+
with:
49+
node-version: ${{ matrix.node-version }}
50+
cache: 'npm'
51+
cache-dependency-path: site/package-lock.json
3852

3953
# 安装和构建 site 目录
4054
- name: Install and build site
@@ -43,7 +57,7 @@ jobs:
4357
npm install
4458
npm run build
4559
46-
# 打包文档
60+
# 打包文档,部署到阿里云 OSS
4761
- name: Zip output
4862
working-directory: site
4963
run: zip -r build/document_archive.zip docs i18n blog versioned_docs versioned_sidebars
@@ -56,3 +70,29 @@ jobs:
5670
# use your own endpoint
5771
endpoint: oss-cn-hongkong.aliyuncs.com
5872
folder: site/build
73+
74+
# 部署到 GitHub Pages
75+
- name: Upload Build Artifact
76+
uses: actions/upload-pages-artifact@v3
77+
with:
78+
path: site/build
79+
80+
deploy:
81+
name: Deploy to GitHub Pages
82+
needs: build
83+
84+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
85+
permissions:
86+
pages: write # to deploy to Pages
87+
id-token: write # to verify the deployment originates from an appropriate source
88+
89+
# Deploy to the github-pages environment
90+
environment:
91+
name: github-pages
92+
url: ${{ steps.deployment.outputs.page_url }}
93+
94+
runs-on: ubuntu-latest
95+
steps:
96+
- name: Deploy to GitHub Pages
97+
id: deployment
98+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)