Skip to content

Commit 5348d5a

Browse files
committed
fix: 修复GitHub Pages部署配置
- 更新工作流使用GitHub Actions官方部署方式 - 添加必要的权限配置(contents:read, pages:write, id-token:write) - 使用actions/configure-pages@v4配置Pages - 使用actions/upload-pages-artifact@v3上传构建产物 - 使用actions/deploy-pages@v4进行部署 - 移除过时的peaceiris/actions-gh-pages配置 - 添加并发控制防止重复部署 - 配置environment环境用于Pages部署
1 parent 6c91a3c commit 5348d5a

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
@@ -5,9 +5,23 @@ on:
55
branches:
66
- main # 触发分支
77

8+
# 设置权限
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
# 允许一个并发部署
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
819
jobs:
920
build-and-deploy:
1021
runs-on: ubuntu-latest
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
1125
steps:
1226
- name: Checkout
1327
uses: actions/checkout@v3
@@ -23,15 +37,14 @@ jobs:
2337
- name: Build
2438
run: npm run build
2539

26-
# - name: Configure Git
27-
# run: |
28-
# git remote set-url origin https://github.com/lim-sec/ai-coding-prompt-builder.git
29-
# git config --global user.name "github-actions[bot]"
30-
# git config --global user.email "[email protected]"
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v4
3142

32-
- name: Deploy to GitHub Pages
33-
uses: peaceiris/actions-gh-pages@v3
43+
- name: Upload artifact
44+
uses: actions/upload-pages-artifact@v3
3445
with:
35-
github_token: ${{ secrets.FUCK_ACTION_GITHUB_TOKEN }}
36-
publish_dir: ./dist
37-
force_orphan: true
46+
path: './dist'
47+
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)