File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Deploy English Docs to gh-pages
2+
3+ on :
4+ push :
5+ branches : [main, master, feature/opt]
6+ paths :
7+ - ' nextra-docs-en/**'
8+ - ' .github/workflows/deploy-docs-en.yml'
9+ workflow_dispatch :
10+
11+ # 设置权限
12+ permissions :
13+ contents : write # 需要写权限以推送到 gh-pages 分支
14+
15+ jobs :
16+ deploy :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0 # 需要完整历史记录
23+
24+ - name : Setup Node.js
25+ uses : actions/setup-node@v4
26+ with :
27+ node-version : ' 20'
28+ cache : ' npm'
29+ cache-dependency-path : ' nextra-docs-en/package-lock.json'
30+
31+ - name : Install dependencies
32+ run : |
33+ cd nextra-docs-en
34+ npm ci --force
35+
36+ - name : Build English docs
37+ run : |
38+ cd nextra-docs-en
39+ npm run build
40+
41+ - name : Deploy to gh-pages branch (en directory)
42+ uses : peaceiris/actions-gh-pages@v3
43+ with :
44+ github_token : ${{ secrets.GITHUB_TOKEN }}
45+ publish_dir : ./nextra-docs-en/out
46+ publish_branch : gh-pages
47+ destination_dir : en
48+ keep_files : true # 保留其他目录的文件(如 zh 目录)
49+
Original file line number Diff line number Diff line change 1+ name : Deploy Chinese Docs to gh-pages
2+
3+ on :
4+ push :
5+ branches : [main, master, feature/opt]
6+ paths :
7+ - ' nextra-docs-zh/**'
8+ - ' .github/workflows/deploy-docs-zh.yml'
9+ workflow_dispatch :
10+
11+ # 设置权限
12+ permissions :
13+ contents : write # 需要写权限以推送到 gh-pages 分支
14+
15+ jobs :
16+ deploy :
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0 # 需要完整历史记录
23+
24+ - name : Setup Node.js
25+ uses : actions/setup-node@v4
26+ with :
27+ node-version : ' 20'
28+ cache : ' npm'
29+ cache-dependency-path : ' nextra-docs-zh/package-lock.json'
30+
31+ - name : Install dependencies
32+ run : |
33+ cd nextra-docs-zh
34+ npm ci --force
35+
36+ - name : Build Chinese docs
37+ run : |
38+ cd nextra-docs-zh
39+ npm run build
40+
41+ - name : Deploy to gh-pages branch (zh directory)
42+ uses : peaceiris/actions-gh-pages@v3
43+ with :
44+ github_token : ${{ secrets.GITHUB_TOKEN }}
45+ publish_dir : ./nextra-docs-zh/out
46+ publish_branch : gh-pages
47+ destination_dir : zh
48+ keep_files : true # 保留其他目录的文件(如 en 目录)
49+
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments