File tree Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Expand file tree Collapse file tree 1 file changed +17
-13
lines changed Original file line number Diff line number Diff line change @@ -2,31 +2,35 @@ name: Deploy to GitHub Pages
22
33on :
44 push :
5- branches :
6- - main # 或者你想要触发部署的其他分支
5+ branches : [ "main" ]
76
87jobs :
9- deploy :
8+ build-and- deploy :
109 runs-on : ubuntu-latest
1110
11+ permissions :
12+ contents : write
13+ pages : write
14+ id-token : write
15+
1216 steps :
1317 - name : Checkout code
14- uses : actions/checkout@v2
18+ uses : actions/checkout@v4
1519
16- - name : Set up Node.js
17- uses : actions/setup-node@v2
20+ - name : Setup Node.js
21+ uses : actions/setup-node@v4
1822 with :
19- node-version : ' 22 '
23+ node-version : 20
2024
2125 - name : Install dependencies
22- run : npm install
26+ run : npm ci
2327
24- - name : Build the project
28+ - name : Build for GitHub Pages
2529 run : npm run build:gh
2630
2731 - name : Deploy to GitHub Pages
28- uses : peaceiris/actions-gh- pages@v3
32+ uses : JamesIves/github- pages-deploy-action@v4
2933 with :
30- github_token : ${{ secrets.GITHUB_TOKEN }}
31- publish_dir : ./ dist
32- publish_branch : gh-pages
34+ branch : gh-pages
35+ folder : dist
36+ token : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments