Skip to content

Commit 4651dee

Browse files
committed
🚀 Add GitHub Actions for multi-language HonKit deployment
- Create GitHub Actions workflow to build zh/ and en/ versions separately - Use HonKit to build each language version independently - Deploy built files to GitHub Pages - Fix 404 issues for /zh/ and /en/ paths
1 parent 7cfe9df commit 4651dee

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Deploy Multi-language HonKit
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
22+
- name: Install HonKit
23+
run: |
24+
npm install -g honkit
25+
26+
- name: Build Chinese version
27+
run: |
28+
cd zh
29+
honkit build _book
30+
31+
- name: Build English version
32+
run: |
33+
cd en
34+
honkit build _book
35+
36+
- name: Deploy to GitHub Pages
37+
uses: peaceiris/actions-gh-pages@v3
38+
if: github.ref == 'refs/heads/main'
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: |
42+
.
43+
zh/_book
44+
en/_book
45+
keep_files: true

0 commit comments

Comments
 (0)