diff --git a/apps/web/src/components/landing/footer.tsx b/apps/web/src/components/landing/footer.tsx index a521b390..4c72f3fc 100644 --- a/apps/web/src/components/landing/footer.tsx +++ b/apps/web/src/components/landing/footer.tsx @@ -141,8 +141,18 @@ export function Footer() { © {new Date().getFullYear()} Stackpanel · MIT licensed · Built on Nix, devenv, Caddy, SOPS, and process-compose
-- Not affiliated with NixOS, devenv, or Cloudflare. +
+ Not affiliated with NixOS, devenv, or Cloudflare. + · + + {__COMMIT_SHA__} +
diff --git a/apps/web/src/types/build-info.d.ts b/apps/web/src/types/build-info.d.ts new file mode 100644 index 00000000..7050391d --- /dev/null +++ b/apps/web/src/types/build-info.d.ts @@ -0,0 +1 @@ +declare const __COMMIT_SHA__: string; diff --git a/apps/web/vite.config.ts b/apps/web/vite.config.ts index 62f7dc12..62322c9f 100644 --- a/apps/web/vite.config.ts +++ b/apps/web/vite.config.ts @@ -2,6 +2,7 @@ import tailwindcss from "@tailwindcss/vite"; import { tanstackStart } from "@tanstack/react-start/plugin/vite"; import viteReact from "@vitejs/plugin-react"; // import alchemy from "alchemy/cloudflare/tanstack-start"; +import { execSync } from "node:child_process"; import type { Plugin } from "vite"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; @@ -30,7 +31,20 @@ function patchImportMetaUrl(): Plugin { const docsProxyUrl = process.env.DOCS_PROXY_URL || "http://localhost:4000"; +const commitSha = (() => { + const fromCi = process.env.GITHUB_SHA; + if (fromCi) return fromCi.slice(0, 7); + try { + return execSync("git rev-parse --short HEAD", { encoding: "utf8" }).trim(); + } catch { + return "unknown"; + } +})(); + export default defineConfig({ + define: { + __COMMIT_SHA__: JSON.stringify(commitSha), + }, plugins: [ tsconfigPaths({ skip: (dir) => dir === ".worktrees" || dir === ".stack",