mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-09 13:01:00 +00:00
The v1.4.42 docker-publish workflow shipped a stale package.json version baked into the bundle because BuildKit reused the pnpm build layer across the release tag bump -- the COPY . . layer key was content-stable relative to the prior build, the layer was warm, and the runtime /api/version read the cached package.json content instead of the new tag. Thread github.ref_name through as a NEXT_PUBLIC_APP_VERSION build-arg from docker-publish.yml. The Dockerfile picks it up as an ARG/ENV in both the builder and runner stages and bakes it into the build context. src/app/api/version/route.ts now reads the env var first and falls through to package.json only when unset (local pnpm dev). The build-arg becomes part of the layer cache key, so every release tag invalidates every downstream layer and the runtime version can never drift from the tag the workflow ran on.