From ba41441d4195490595a10a10ba472215fc5a1e45 Mon Sep 17 00:00:00 2001
From: Bernt Christian Egeland
Date: Thu, 6 Apr 2023 21:42:01 +0000
Subject: [PATCH] app version
---
Dockerfile | 2 +-
src/components/modules/footer.tsx | 7 +++----
src/utils/global.ts | 2 ++
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 46ae04c4..43a6ac9f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -58,8 +58,8 @@ RUN \
FROM base AS runner
WORKDIR /app
# set the app version as an environment variable. Used in the github action
+# used in the init-db.sh script
ARG NEXT_PUBLIC_APP_VERSION
-ENV NEXT_PUBLIC_APP_VERSION ${NEXT_PUBLIC_APP_VERSION}
ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
diff --git a/src/components/modules/footer.tsx b/src/components/modules/footer.tsx
index 597f84a9..f5f8dd31 100644
--- a/src/components/modules/footer.tsx
+++ b/src/components/modules/footer.tsx
@@ -1,4 +1,5 @@
import React from "react";
+import { globalSiteVersion } from "~/utils/global";
const Footer = () => (
- {process.env.NEXT_PUBLIC_APP_VERSION ? (
-
- {process.env.NEXT_PUBLIC_APP_VERSION}
-
+ {globalSiteVersion ? (
+
{globalSiteVersion}
) : (
)}
diff --git a/src/utils/global.ts b/src/utils/global.ts
index b7e5e767..a13d2ea6 100644
--- a/src/utils/global.ts
+++ b/src/utils/global.ts
@@ -2,3 +2,5 @@
// If it is not set, use the default value "Next ZTnet".
export const globalSiteTitle =
process.env.NEXT_PUBLIC_SITE_NAME || "Next ZTnet";
+
+export const globalSiteVersion = process.env.NEXT_PUBLIC_APP_VERSION || null;