Wire up deployment metadata: build commit, number, and server start time; v2.0.30
Publish Container / docker (push) Successful in 14m11s

- Dockerfile: expose BUILD_COMMIT and BUILD_NUMBER env vars from build args
  (was COMMIT_SHA only; server was reading BUILD_COMMIT so it always fell through to null)
- CI: pass github.run_number as BUILD_NUMBER build arg
- state.js: record serverStartedAt at module load so deployedAt always shows
  when the current container instance came up, even without an env var
- admin-content.js: fall back COMMIT_SHA → BUILD_COMMIT for older images,
  use state.serverStartedAt when DEPLOYED_AT env var not set

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 4.6 committed 2026-09-17 16:52:44 -04:00
1 parent 4002f1ee93
commit 65623ce0eb
5 files changed
+9 -4

No files matched your search

+1
View File
@@ -63,3 +63,4 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
COMMIT_SHA=${{ github.sha }}
BUILD_NUMBER=${{ github.run_number }}
+3 -1
View File
@@ -12,7 +12,9 @@ ENV NODE_ENV=production
ENV PORT=4173
ARG COMMIT_SHA=unknown
ENV COMMIT_SHA=${COMMIT_SHA}
ARG BUILD_NUMBER=unknown
ENV BUILD_COMMIT=${COMMIT_SHA}
ENV BUILD_NUMBER=${BUILD_NUMBER}
COPY --from=deps /app/node_modules ./node_modules
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "siteforge",
"private": true,
"version": "2.0.29",
"version": "2.0.30",
"type": "module",
"scripts": {
"dev": "vite",
+2 -2
View File
@@ -227,9 +227,9 @@ export function register(app) {
app.get('/api/admin-ops/status', requireAdminAuth, (_req, res) => {
res.json({
buildCommit: process.env.BUILD_COMMIT ?? null,
buildCommit: process.env.BUILD_COMMIT ?? process.env.COMMIT_SHA ?? null,
buildNumber: process.env.BUILD_NUMBER ?? null,
deployedAt: process.env.DEPLOYED_AT ?? null,
deployedAt: process.env.DEPLOYED_AT ?? state.serverStartedAt,
cachePurge: state.lastCachePurgeStatus,
deployHook: state.lastDeployHookStatus,
})
+2
View File
@@ -7,6 +7,8 @@ import {
} from './config.js'
export const state = {
serverStartedAt: new Date().toISOString(),
cachedSiteContent: null,
cachedDraftSiteContent: null,
publishState: { ...DEFAULT_PUBLISH_STATE },