File tree Expand file tree Collapse file tree 2 files changed +28
-13
lines changed
Expand file tree Collapse file tree 2 files changed +28
-13
lines changed Original file line number Diff line number Diff line change 1- name : Deploy Hugo site to GitHub Pages
1+ name : Build and deploy
22
33on :
44 push :
55 branches :
6- - main # 监听 main 分支的推送事件
7- workflow_dispatch : # 允许手动触发
6+ - main
7+ workflow_dispatch :
88
99permissions :
1010 contents : read
1111 pages : write
1212 id-token : write
1313
1414concurrency :
15- group : " pages"
15+ group : pages
1616 cancel-in-progress : false
1717
18+ defaults :
19+ run :
20+ shell : bash
21+
1822jobs :
1923 build :
2024 runs-on : ubuntu-latest
2125 env :
22- HUGO_VERSION : 0.156.0 # 可以指定你需要的Hugo版本
26+ HUGO_VERSION : 0.156.0
2327 steps :
2428 - name : Checkout
25- uses : actions/checkout@v4
29+ uses : actions/checkout@v6
2630 with :
2731 submodules : recursive
28- - name : Setup Hugo
29- uses : peaceiris/actions-hugo@v3
30- with :
31- hugo-version : ' ${{ env.HUGO_VERSION }}'
32- extended : true
33- - name : Build
34- run : hugo --minify
32+ fetch-depth : 0
33+ - name : Setup Pages
34+ id : pages
35+ uses : actions/configure-pages@v5
36+ - name : Install Hugo
37+ run : |
38+ wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
39+ sudo dpkg -i ${{ runner.temp }}/hugo.deb
40+ - name : Build the site
41+ run : |
42+ hugo \
43+ --gc \
44+ --minify \
45+ --baseURL "${{ steps.pages.outputs.base_url }}/"
3546 - name : Upload artifact
3647 uses : actions/upload-pages-artifact@v3
3748 with :
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ title: 0xdra
44theme : ["PaperMod"]
55defaultContentLanguage : zh
66
7+ caches :
8+ images :
9+ dir : :cacheDir/images
10+
711languages :
812 zh :
913 weight : 1
You can’t perform that action at this time.
0 commit comments