Skip to content

Commit ef2c771

Browse files
committed
setup hugo using separate action, build via discrete command
1 parent cd298bc commit ef2c771

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/main.yaml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ jobs:
99
contents: 'read'
1010
id-token: 'write'
1111
env:
12+
# define Hugo cachedir so it is not version dependent
13+
HUGO_CACHEDIR: /tmp/hugo_cache
1214
IMAGE_NAME: 'lichturm-website'
1315
IMAGE_TAG: 'prod'
1416
runs-on: 'ubuntu-latest'
@@ -20,11 +22,23 @@ jobs:
2022
with:
2123
submodules: 'recursive'
2224

23-
# https://github.com/jakejarvis/hugo-build-action
24-
- name: Build Website
25-
uses: 'jakejarvis/[email protected]'
25+
# https://github.com/peaceiris/actions-hugo
26+
- name: Setup Hugo
27+
uses: peaceiris/actions-hugo@v3
28+
with:
29+
hugo-version: '0.131.0'
30+
31+
# cache the hugo output, so that only what has changed has to be regenerated
32+
# https://github.com/actions/cache
33+
- uses: actions/cache@v4
2634
with:
27-
args: '--minify'
35+
path: ${{ env.HUGO_CACHEDIR }}
36+
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.sum') }}
37+
restore-keys: |
38+
${{ runner.os }}-hugomod-
39+
40+
- name: Build Website
41+
run: 'hugo --minify'
2842

2943
# so we can inspect what is being produced
3044
# https://github.com/actions/upload-artifact
@@ -77,6 +91,7 @@ jobs:
7791
push: true
7892
tags: '${{ secrets.CONTAINER_REGISTRY_URL }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}'
7993

94+
# once we are bored of building containers
8095
# - name: Install s3cmd
8196
# run: |
8297
# pip install s3cmd

0 commit comments

Comments
 (0)