Expose build commit/branch to templates via SITE_COMMIT/SITE_BRANCH
Build and deploy / build-and-deploy (push) Successful in 27s

pelicanconf.py reads them from env vars (blank on a plain local
build); the CI workflow's Build step now sets SITE_COMMIT (short SHA)
and SITE_BRANCH before invoking pelican. Bumps the theme submodule to
pick up the matching footer change (427fd9d).
This commit was merged in pull request #2.
This commit is contained in:
2026-08-14 11:12:23 +00:00
parent 88e3a8cf1a
commit 176263bea0
3 changed files with 13 additions and 1 deletions
+5
View File
@@ -59,9 +59,14 @@ jobs:
# main -> real prod config; staging -> prod-like preview (feeds,
# absolute URLs) pointed at the dev webserver; devel (or anything
# else) -> bare pelicanconf.py, same as a plain local build.
# SITE_COMMIT/SITE_BRANCH are picked up by pelicanconf.py (and thus
# every config that imports it) for the footer build-info line.
env:
REF_NAME: ${{ github.ref_name }}
GITEA_SHA: ${{ github.sha }}
run: |
export SITE_COMMIT=$(echo "$GITEA_SHA" | cut -c1-8)
export SITE_BRANCH="$REF_NAME"
if [ "$REF_NAME" = "main" ]; then
pelican -s publishconf.py
elif [ "$REF_NAME" = "staging" ]; then