Skip to content

Commit 66f9872

Browse files
committed
ci: 优化 GitHub Pages 部署配置 - 切换到 peaceiris/actions-gh-pages,简化部署流程,添加 force_orphan 确保使用干净的 gh-pages 分支
1 parent e6dcc12 commit 66f9872

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

.github/workflows/deploy.yml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,10 @@ jobs:
4444
# 设置 BASE_URL 环境变量,确保资源路径正确
4545
BASE_URL: /ast-explorer-helper/
4646

47-
- name: Setup Pages
48-
uses: actions/configure-pages@v4
49-
50-
- name: Upload artifact
51-
uses: actions/upload-pages-artifact@v3
47+
- name: Deploy 🚀
48+
uses: peaceiris/actions-gh-pages@v4
5249
with:
53-
path: office-website/dist
54-
55-
deploy:
56-
needs: build
57-
runs-on: ubuntu-latest
58-
59-
# 指定环境为 github-pages
60-
environment:
61-
name: github-pages
62-
url: ${{ steps.deployment.outputs.page_url }}
63-
64-
steps:
65-
- name: Deploy to GitHub Pages
66-
id: deployment
67-
uses: actions/deploy-pages@v4
50+
github_token: ${{ secrets.GITHUB_TOKEN }}
51+
publish_dir: ./dist
52+
force_orphan: true # 确保使用干净的 gh-pages 分支
53+
commit_message: "deploy: 更新 GitHub Pages 站点"

0 commit comments

Comments
 (0)