File tree Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Expand file tree Collapse file tree 3 files changed +34
-5
lines changed Original file line number Diff line number Diff line change 3030 with:
3131 github_token: ${{ secrets.GITHUB_TOKEN }}
3232 publish_dir: ./public
33- publish_branch: gh-pages # 明确指定目标分支
33+ publish_branch: gh-pages # 明确指定目标分支
Original file line number Diff line number Diff line change 1+ name : Deploy to GitHub Pages
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-22.04 # 固定使用22.04版本
11+ steps :
12+ - name : Checkout code
13+ uses : actions/checkout@v4 # 升级到v4版本
14+ with :
15+ submodules : recursive # 改为更明确的recursive
16+ fetch-depth : 0
17+
18+ - name : Setup Hugo
19+ uses : peaceiris/actions-hugo@v2
20+ with :
21+ hugo-version : " latest"
22+ extended : true
23+
24+ - name : Build site
25+ run : hugo --minify
26+
27+ - name : Deploy to gh-pages
28+ uses : peaceiris/actions-gh-pages@v3
29+ if : github.ref == 'refs/heads/master'
30+ with :
31+ github_token : ${{ secrets.GITHUB_TOKEN }}
32+ publish_dir : ./public
33+ publish_branch : gh-pages # 明确指定目标分支
Original file line number Diff line number Diff line change 1919 env :
2020 HUGO_VERSION : 0.125.0
2121 steps :
22- # 覆盖潜在的旧版依赖
23- - name : Patch Actions Dependency
24- uses : actions/upload-artifact@v4
25- if : true
2622
2723 - name : Install Hugo CLI
2824 run : |
You can’t perform that action at this time.
0 commit comments