File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -3,20 +3,26 @@ name: Deploy to GitHub Pages
33on :
44 push :
55 branches :
6- - main # 每次推送到main分支时触发
6+ - main
7+
8+ # 设置 GITHUB_TOKEN 的权限
9+ permissions :
10+ contents : write
11+ pages : write
12+ id-token : write
713
814jobs :
915 build-and-deploy :
1016 runs-on : ubuntu-latest
1117
1218 steps :
1319 - name : Checkout code
14- uses : actions/checkout@v3
20+ uses : actions/checkout@v4
1521
1622 - name : Setup Node.js
17- uses : actions/setup-node@v3
23+ uses : actions/setup-node@v4
1824 with :
19- node-version : ' 16 '
25+ node-version : ' 18 '
2026 cache : ' npm'
2127
2228 - name : Install dependencies
@@ -25,11 +31,11 @@ jobs:
2531 - name : Build project
2632 run : npm run build
2733 env :
28- CI : false # 允许有警告的情况下继续构建
34+ CI : false
2935
3036 - name : Deploy to GitHub Pages
3137 uses : JamesIves/github-pages-deploy-action@v4
3238 with :
33- folder : build # 构建输出的文件夹
34- branch : gh-pages # 部署的目标分支
35- clean : true # 清理旧文件
39+ folder : build
40+ branch : gh-pages
41+ clean : true
You can’t perform that action at this time.
0 commit comments