Mettre à jour Hugo
Pour documentation#27 (closed), il faut mettre à jour l'image dans le registre de conteneur pour la dernière version de Hugo.
- Définir une variable
HUGO_VERSIONavec pour valeur la dernière version de Hugo par défaut - Changer l'image d'origine pour
hugomods/hugo:exts(voir https://gitlab.com/pages/hugo et https://docker.hugomods.com/docs/tags/#exts) ou une image plus légère - Ajouter une étiquette correspondant à la version de Hugo choisie
Idées :
Dockerfile :
FROM registry.gitlab.com/pages/hugo/hugo_extended:${HUGO_VERSION}
.gitlab-ci.yml :
variables:
#...
HUGO_VERSION:
description: "Select the HUGO version. Valid options are: 'canary', 'staging', 'production', or a stable branch of your choice."
value: "0.146.5"
build-image:
#...
script:
- docker build --build-arg HUGO_VERSION=$HUGO_VERSION -t $CI_REGISTRY_IMAGE:latest -t $CI_REGISTRY_IMAGE:$HUGO_VERSION .
- docker push $CI_REGISTRY_IMAGE --all-tags