File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : Deploy Hugo site to Pages
22
33on :
4- # Runs on pushes targeting the default branch
54 push :
65 branches : ["main"]
7-
8- # Allows you to run this workflow manually from the Actions tab
96 workflow_dispatch :
107
11- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
128permissions :
139 contents : read
1410 pages : write
1511 id-token : write
1612
17- # Allow one concurrent deployment
1813concurrency :
1914 group : " pages"
2015 cancel-in-progress : true
2116
22- # Default to bash
2317defaults :
2418 run :
2519 shell : bash
2620
2721jobs :
28- # Build job
2922 build :
3023 runs-on : ubuntu-latest
3124 env :
32- HUGO_VERSION : 0.142.0 # the same as on my machine (Fedora dev box)
25+ HUGO_VERSION : 0.152.0
3326 steps :
34- - name : Install Hugo CLI
35- run : |
36- wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
37- && sudo dpkg -i ${{ runner.temp }}/hugo.deb
3827 - name : Checkout
3928 uses : actions/checkout@v4
4029 with :
4130 submodules : recursive
4231 fetch-depth : 0
32+
33+ - name : Setup Hugo
34+ uses : peaceiris/actions-hugo@v3
35+ with :
36+ hugo-version : ${{ env.HUGO_VERSION }}
37+ extended : true
38+
4339 - name : Setup Pages
4440 id : pages
4541 uses : actions/configure-pages@v4
42+
4643 - name : Build with Hugo
4744 env :
4845 HUGO_ENVIRONMENT : production
49- HUGO_ENV : production
5046 TZ : Europe/Prague
5147 run : |
52- hugo --gc --minify
48+ hugo \
49+ --gc \
50+ --minify \
51+ --baseURL "${{ steps.pages.outputs.base_url }}/"
52+
5353 - name : Upload artifact
5454 uses : actions/upload-pages-artifact@v3
5555 with :
5656 path : ./public
5757
58- # Deployment job
5958 deploy :
6059 environment :
6160 name : github-pages
You can’t perform that action at this time.
0 commit comments