build: stamp the version in the stage that ships it

The release workflow has never published. Every run since v1.1.19 built
cleanly and then died on its own smoke gate:

    image stamps <unset> but is published as v1.1.23

The gate was right. GIT_TAG and GIT_COMMIT_SHA were declared as ARG/ENV
only in the `builder` stage, and ENV does not cross a stage boundary, so
they reached the compiled bundle and never the runtime image. The footer
resolves at container start, not at build time — make_envs_script.sh
iterates the live process environment into window.__envs and
configs/app/ui.ts reads frontendVersion from there — so with nothing set
in the final stage, every image ever published reported no version.
`crane config ghcr.io/luxfi/explore:v1.1.23` confirms it: no
NEXT_PUBLIC_GIT_TAG in the config at all, and the deployed ConfigMaps do
not supply one either.

Declare both in the runner stage, after the copies so a new commit
invalidates only the ENV layer.

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-08-06 21:15:59 -07:00
co-authored by Hanzo Dev
parent 2538bb5204
commit df44be36a4
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -152,6 +152,18 @@ COPY ./configs/envs ./configs/envs
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# The build stamp has to be declared HERE, in the final stage. ENV does not
# cross stage boundaries, so the copies in the builder above reach the compiled
# bundle and nothing else, and the footer reads this at container start, not at
# build time: make_envs_script.sh iterates the running process environment into
# window.__envs, and configs/app/ui.ts serves frontendVersion out of that. Left
# to the builder alone, every image ever published reported no version at all.
# Last, so a new commit invalidates only this layer and not the copies above.
ARG GIT_COMMIT_SHA
ENV NEXT_PUBLIC_GIT_COMMIT_SHA=$GIT_COMMIT_SHA
ARG GIT_TAG
ENV NEXT_PUBLIC_GIT_TAG=$GIT_TAG
ENTRYPOINT ["./entrypoint.sh"]
USER nextjs
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@luxfi/explore",
"version": "1.1.23",
"version": "1.1.24",
"private": false,
"homepage": "https://github.com/luxfi/explore#readme",
"engines": {