diff --git a/.kontinuous/values.yaml b/.kontinuous/values.yaml index b6fa9596..682187d4 100644 --- a/.kontinuous/values.yaml +++ b/.kontinuous/values.yaml @@ -23,3 +23,4 @@ jobs: # pass a custom docker build arg buildArgs: GITHUB_SHA: "{{ $.Values.global.sha }}" + NEXT_PUBLIC_SITE_URL: "https://{{ $.Values.global.host }}" diff --git a/Dockerfile b/Dockerfile index a38ecda6..324d1fc1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,10 +19,15 @@ RUN yarn install --frozen-lockfile # Rebuild the source code only when needed FROM node:$NODE_VERSION AS builder + ARG PRODUCTION -ENV NODE_ENV production +ENV PRODUCTION $PRODUCTION ARG GITHUB_SHA ENV GITHUB_SHA $GITHUB_SHA +ARG NEXT_PUBLIC_SITE_URL +ENV NEXT_PUBLIC_SITE_URL $NEXT_PUBLIC_SITE_URL + +ENV NODE_ENV production WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . diff --git a/next.config.js b/next.config.js index 112b6317..2d1867f2 100644 --- a/next.config.js +++ b/next.config.js @@ -25,7 +25,6 @@ const moduleExports = { env: { NEXT_PUBLIC_APP_VERSION: version, NEXT_PUBLIC_APP_VERSION_COMMIT: process.env.GITHUB_SHA, - NEXT_PUBLIC_IS_PRODUCTION_DEPLOYMENT: process.env.PRODUCTION, CONTENT_SECURITY_POLICY: ContentSecurityPolicy, }, }; diff --git a/pages/_app.tsx b/pages/_app.tsx index 412be890..4dbb6fcc 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -76,6 +76,18 @@ const bottomLinks = [ href: "/stats", }, }, + { + text: "Contribuer sur GitHub", + linkProps: { + href: `${process.env.NEXT_PUBLIC_APP_REPOSITORY_URL}${ + process.env.NEXT_PUBLIC_APP_VERSION + ? `/releases/tag/v${process.env.NEXT_PUBLIC_APP_VERSION}` + : process.env.NEXT_PUBLIC_APP_VERSION_COMMIT + ? `/commit/${process.env.NEXT_PUBLIC_APP_VERSION}` + : "" + }`, + }, + }, ]; function App({ Component, pageProps }: AppProps) { diff --git a/scripts/prebuild.ts b/scripts/prebuild.ts index 1825e38c..2b55dd85 100644 --- a/scripts/prebuild.ts +++ b/scripts/prebuild.ts @@ -19,7 +19,7 @@ export const generateRobotsTxt = (isOnProduction: boolean, host: string) => { const run = () => { generateRobotsTxt( - process.env.NEXT_PUBLIC_IS_PRODUCTION_DEPLOYMENT ? true : false, + process.env.PRODUCTION ? true : false, process.env.NEXT_PUBLIC_SITE_URL ?? "localhost" ); console.log("Robots.txt generated.");