Skip to content

Commit

Permalink
app version
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Apr 6, 2023
1 parent 395906f commit ba41441
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions src/components/modules/footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import { globalSiteVersion } from "~/utils/global";

const Footer = () => (
<footer className="hidden px-4 py-6 sm:block">
Expand All @@ -11,10 +12,8 @@ const Footer = () => (
by Bernt Christian Egeland / aka @sinamics
</a>
</p>
{process.env.NEXT_PUBLIC_APP_VERSION ? (
<p className="text-right text-sm text-gray-600">
{process.env.NEXT_PUBLIC_APP_VERSION}
</p>
{globalSiteVersion ? (
<p className="text-right text-sm text-gray-600">{globalSiteVersion}</p>
) : (
<div></div>
)}
Expand Down
2 changes: 2 additions & 0 deletions src/utils/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit ba41441

Please sign in to comment.