From 288baae676b3038da81168f68e526ec963f3bf3b Mon Sep 17 00:00:00 2001 From: nmemmert Date: Thu, 16 Jul 2026 08:00:29 -0400 Subject: [PATCH] Fix version commit SHA showing as unknown in Docker (v1.0.1) The runtime image doesn't include .git, so git rev-parse failed at startup. Fix: pass COMMIT_SHA as a Docker build arg from github.sha in CI and bake it into the image as an ENV var, which config.js already prefers over running git. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/docker-publish.yml | 2 ++ Dockerfile | 3 +++ package.json | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index d05aee5..50944f4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -60,3 +60,5 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + build-args: | + COMMIT_SHA=${{ github.sha }} diff --git a/Dockerfile b/Dockerfile index bcd4ecc..50af759 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,9 @@ WORKDIR /app ENV NODE_ENV=production ENV PORT=4173 +ARG COMMIT_SHA=unknown +ENV COMMIT_SHA=${COMMIT_SHA} + COPY package*.json ./ RUN npm ci --omit=dev --legacy-peer-deps diff --git a/package.json b/package.json index 4655d3d..8f0287b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "1.0.0", + "version": "1.0.1", "type": "module", "scripts": { "dev": "vite",