mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
feat: add GIT_COMMIT_HASH support for versioning in Dockerfile and footer
This commit is contained in:
@@ -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
|
||||
|
||||
Vendored
+1
@@ -27,6 +27,7 @@ declare global {
|
||||
| undefined;
|
||||
var turnstileLoaded: (() => void) | undefined;
|
||||
declare const __APP_VERSION__: string;
|
||||
declare const COMMIT_HASH: string;
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
@@ -19,4 +19,13 @@
|
||||
>
|
||||
<span class="mx-1">•</span>
|
||||
v{__APP_VERSION__}
|
||||
<a
|
||||
href="https://github.com/whoswhip/Sharpbin/commit/{COMMIT_HASH}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
class="text-neutral-400 underline hover:text-neutral-200"
|
||||
>{(COMMIT_HASH?.length ?? 0) >= 7 && COMMIT_HASH !== 'unknown'
|
||||
? `(${COMMIT_HASH.slice(0, 7)})`
|
||||
: ''}</a
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user