Pin checksummed Hugo download in shared workflow
All checks were successful
Publish Hugo Deployment Image / publish (push) Successful in 54s

The deploy job downloads Hugo Extended 0.165.0 from the GitHub release,
verifies its SHA-256 and runs it from RUNNER_TEMP instead of the runner's
auto-refreshing snap. Deploys fail before rsync if hugo is a different
version, not Extended, or not the pinned binary.
This commit is contained in:
Neil Borromeo 2026-10-19 15:48:34 +08:00
commit 366b448bb0

View file

@ -12,20 +12,23 @@ Shared Forgejo deployment workflow for Develton-managed Hugo sites.
- Repository must be public if other repos call the reusable workflow directly
- Caller repository variables and secrets documented below
- The runner host must provide `hugo`, `node`, `rsync`, and `ssh` on `PATH`
- The runner host must provide `curl`, `tar`, `sha256sum`, `rsync`, and `ssh` on `PATH`; the workflow downloads Hugo itself
## Sites
- `neilb.com`
- `neilborromeo.com`
- `boholtoday.com`
- `boholcentral.com`
- `cloud.develton.com`
- `komsysnet.com`
- `thefreelancemastery.com`
All five sites deploy through the shared workflow, which downloads Hugo Extended 0.165.0 from the GitHub release, verifies its pinned SHA-256, and runs it from `$RUNNER_TEMP`. A checksum mismatch, a different version, a non-Extended build, or any other `hugo` first on `PATH` fails before deployment.
To change the version, update `HUGO_VERSION` and `HUGO_SHA256` together (hash from `hugo_<version>_checksums.txt`), plus the Dockerfile ARG and the tests.
## Image Publishing
The legacy publish workflow can still publish the old container image, but normal deployments no longer use it. Hugo deploys run directly on the runner host so they can use the host Hugo binary and avoid nested container deployment paths.
The legacy publish workflow can still publish the old container image, but normal deployments no longer use it. The legacy image is also pinned to Hugo Extended 0.165.0. Hugo deploys run directly on the runner host so they can use the pinned Hugo download and avoid nested container deployment paths.
- Pushes to `main` publish `registry.develton.com/cliper/hugo-deployment:<commit-sha>` and also move `latest`
- Pushes of Git tags like `v1` publish the matching image tag without moving `latest`
@ -56,7 +59,7 @@ Site repos call the shared workflow with:
jobs:
deploy:
runs-on: develton-hugo
uses: https://git.develton.com/cliper/hugo_deployment/.forgejo/workflows/deploy-hugo-site.yml@v1
uses: https://git.develton.com/cliper/hugo_deployment/.forgejo/workflows/deploy-hugo-site.yml@main
with:
deploy_script: ./scripts/deploy.sh
secrets: