Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

Commit

Permalink
fix: github footer
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien Bouquillon committed Feb 3, 2023
1 parent 2bc0257 commit 1b400a2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions .kontinuous/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .
Expand Down
1 change: 0 additions & 1 deletion next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
};
Expand Down
12 changes: 12 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/prebuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 1b400a2

Please sign in to comment.