diff --git a/SharpbinV3.Client/Dockerfile b/SharpbinV3.Client/Dockerfile
index c1d8241..aa29f85 100644
--- a/SharpbinV3.Client/Dockerfile
+++ b/SharpbinV3.Client/Dockerfile
@@ -1,5 +1,7 @@
# syntax=docker/dockerfile:1
FROM node:20-alpine as build
+ARG GIT_COMMIT_HASH
+ENV GIT_COMMIT_HASH=${GIT_COMMIT_HASH}
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
diff --git a/SharpbinV3.Client/src/app.d.ts b/SharpbinV3.Client/src/app.d.ts
index e0ca175..af7db7c 100644
--- a/SharpbinV3.Client/src/app.d.ts
+++ b/SharpbinV3.Client/src/app.d.ts
@@ -27,6 +27,7 @@ declare global {
| undefined;
var turnstileLoaded: (() => void) | undefined;
declare const __APP_VERSION__: string;
+ declare const COMMIT_HASH: string;
}
export {};
diff --git a/SharpbinV3.Client/src/lib/components/Footer.svelte b/SharpbinV3.Client/src/lib/components/Footer.svelte
index f76118b..0cfb382 100644
--- a/SharpbinV3.Client/src/lib/components/Footer.svelte
+++ b/SharpbinV3.Client/src/lib/components/Footer.svelte
@@ -19,4 +19,13 @@
>
•
v{__APP_VERSION__}
+ {(COMMIT_HASH?.length ?? 0) >= 7 && COMMIT_HASH !== 'unknown'
+ ? `(${COMMIT_HASH.slice(0, 7)})`
+ : ''}
diff --git a/SharpbinV3.Client/vite.config.ts b/SharpbinV3.Client/vite.config.ts
index 20fd27a..05caf61 100644
--- a/SharpbinV3.Client/vite.config.ts
+++ b/SharpbinV3.Client/vite.config.ts
@@ -16,7 +16,8 @@ const allowedHosts = process.env.VITE_ALLOWED_HOSTS
export default defineConfig({
plugins: [tailwindcss(), sveltekit()],
define: {
- __APP_VERSION__: JSON.stringify(pkg.version)
+ __APP_VERSION__: JSON.stringify(pkg.version),
+ COMMIT_HASH: JSON.stringify(process.env.GIT_COMMIT_HASH || 'unknown')
},
server: {
host: true,