diff --git a/website/deploy-ci.sh b/website/deploy-ci.sh index 608d55d..f7c781e 100755 --- a/website/deploy-ci.sh +++ b/website/deploy-ci.sh @@ -11,6 +11,13 @@ HERE="$(cd "$(dirname "$0")" && pwd)" SRCROOT="${FURTKA_SRCROOT:-/srv/furtka-site}" WEBROOT="${FURTKA_WEBROOT:-/var/www/furtka.org}" +# The runner job runs as root inside the container; hand the trees back +# to the VM user no matter how this script ends, so the manual deploy.sh +# path keeps working even after a failed build. +if [ "$(id -u)" = 0 ]; then + trap 'chown -R "${FURTKA_OWNER:-1000:1000}" "$SRCROOT" "$WEBROOT"' EXIT +fi + echo "==> rsync website/ → $SRCROOT" rsync -az --delete \ --exclude='.hugo_build.lock' \ @@ -24,10 +31,4 @@ echo "==> hugo build → $WEBROOT" cd "$SRCROOT" hugo --minify --cleanDestinationDir -d "$WEBROOT" -# The runner job runs as root inside the container; hand the trees back -# to the VM user so the manual deploy.sh path keeps working afterwards. -if [ "$(id -u)" = 0 ]; then - chown -R "${FURTKA_OWNER:-1000:1000}" "$SRCROOT" "$WEBROOT" -fi - echo "OK: deployed to https://furtka.org/" diff --git a/website/layouts/poll/single.html b/website/layouts/poll/single.html index e62b99b..ae1065a 100644 --- a/website/layouts/poll/single.html +++ b/website/layouts/poll/single.html @@ -1,7 +1,7 @@ {{ define "main" }} {{- $p := .Params -}} -{{- $M := hugo.Data.logo.m -}} -{{- $R := hugo.Data.logo.r -}} +{{- $M := site.Data.logo.m -}} +{{- $R := site.Data.logo.r -}} {{- $s := $p.show -}}