Skip to content

Commit e3accb5

Browse files
committed
🔧 Fix GitHub Actions workflow
- Add proper permissions for GitHub Pages deployment - Use official GitHub Pages actions instead of third-party - Fix HonKit build commands (remove _book parameter) - Add concurrency control to prevent conflicts - Use upload-pages-artifact and deploy-pages actions
1 parent 4651dee commit e3accb5

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

.github/workflows/deploy.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,17 @@ name: Deploy Multi-language HonKit
33
on:
44
push:
55
branches: [ main ]
6-
pull_request:
7-
branches: [ main ]
6+
7+
# 设置权限
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
# 确保只有一个作业在运行
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
817

918
jobs:
1019
build-and-deploy:
@@ -26,20 +35,24 @@ jobs:
2635
- name: Build Chinese version
2736
run: |
2837
cd zh
29-
honkit build _book
38+
honkit build
3039
3140
- name: Build English version
3241
run: |
3342
cd en
34-
honkit build _book
43+
honkit build
3544
36-
- name: Deploy to GitHub Pages
37-
uses: peaceiris/actions-gh-pages@v3
38-
if: github.ref == 'refs/heads/main'
45+
- name: Setup Pages
46+
uses: actions/configure-pages@v4
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v3
3950
with:
40-
github_token: ${{ secrets.GITHUB_TOKEN }}
41-
publish_dir: |
51+
path: |
4252
.
4353
zh/_book
4454
en/_book
45-
keep_files: true
55+
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)