Skip to content

Commit

Permalink
chore: switch to (maintained and arm64 compliant) hugomods/hugo Docke…
Browse files Browse the repository at this point in the history
…r image for Hugo

Signed-off-by: Damien Duportal <[email protected]>
  • Loading branch information
dduportal committed Nov 7, 2024
1 parent 4b4d984 commit 180fff3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 34 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ jobs:
with:
# this is needed to checkout theme which normally come from separate git repository
submodules: true
- name: hugo
uses: klakegg/actions-hugo@832127b60a59f4ac9e5adda72cc8223a9b8473a0 # 1.0.0
with:
version: 0.95.0
# "ext-" for the Hugo extended edition including git (https://github.com/klakegg/docker-hugo/blob/master/README.md#hugo-extended-edition)
image: ext-asciidoctor
- name: Check site can be built with the docker compose image
run: docker compose --profile=donotstart up build
16 changes: 11 additions & 5 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
x-base: &base
image: hugomods/hugo:ci-0.95.0
volumes:
- .:/src

services:
status:
# "ext-" for the Hugo extended edition including git (https://github.com/klakegg/docker-hugo/blob/master/README.md#hugo-extended-edition)
image: klakegg/hugo:0.95.0-ext-asciidoctor
volumes:
- .:/src
<<: *base
ports:
- 1313:1313
command: "serve --cleanDestinationDir --disableFastRender --printPathWarnings --printMemoryUsage --verbose --verboseLog --noHTTPCache"
command: "hugo serve --bind 0.0.0.0 --cleanDestinationDir --disableFastRender --printPathWarnings --printMemoryUsage --noHTTPCache"
build:
<<: *base
profiles:
- donotstart
38 changes: 15 additions & 23 deletions updatecli/updatecli.d/hugo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,61 +14,53 @@ scms:

sources:
# Get Hugo Version from Github Releases
getLatestDockerHugoVersion:
getLatestVersion:
kind: githubrelease
name: Get the latest hugo version
spec:
owner: "klakegg"
repository: "docker-hugo"
owner: gohugoio
repository: hugo
token: "{{ requiredEnv .github.token }}"
username: "{{ .github.username }}"
versionfilter:
kind: latest
transformers:
- trimprefix: v

conditions:
checkIfDockerImageIsPublished:
name: "Test if the docker image 'klakegg/hugo' is available on the DockerHub registry"
name: "Test if the docker image 'hugomods/hugo:ci-<version>' is available on the DockerHub registry"
sourceid: getLatestVersion
transformers:
- addsuffix: "-ext-asciidoctor"
sourceid: getLatestDockerHugoVersion
- addprefix: 'ci-'
kind: dockerimage
spec:
image: "klakegg/hugo"
image: "hugomods/hugo"
architecture: amd64
# Tag comes from the sourceid (+ transformation)

targets:
updateDockerComposeFile:
transformers:
- addprefix: "klakegg/hugo:"
- addsuffix: "-ext-asciidoctor"
name: "Update Hugo version in docker image name in docker-compose.yaml"
transformers:
- addprefix: "hugomods/hugo:ci-"
kind: yaml
spec:
engine: yamlpath
file: docker-compose.yaml
key: services.status.image
key: $.x-base.image
scmid: default
updateNetlifyConfig:
kind: file
name: "Update Hugo version in the Netlify configuration file"
spec:
file: netlify.toml
matchpattern: "HUGO_VERSION = .*"
content: 'HUGO_VERSION = "{{ source `getLatestDockerHugoVersion` }}"'
scmid: default
updateGitHubWorkflow:
kind: yaml
name: "Update Hugo version in the Netlify configuration file"
spec:
file: .github/workflows/hugo.yaml
key: jobs.build.steps[1].with.version
content: 'HUGO_VERSION = "{{ source `getLatestVersion` }}"'
scmid: default

actions:
chart:
kind: github/pullrequest
scmid: default
title: Bump Hugo version to {{ source `getLatestDockerHugoVersion` }}
title: Bump Hugo version to {{ source `getLatestVersion` }}
spec:
labels:
- dependencies
Expand Down

0 comments on commit 180fff3

Please sign in to comment.