From db7646101d1f62603421c03058b590dd3313defa Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Thu, 16 Feb 2023 16:08:25 -0800 Subject: [PATCH] Set repository name in links based on env variable So that links work after transferring the repository. --- .github/workflows/build-and-deploy.yml | 1 + .github/workflows/build.yml | 1 + next.config.js | 3 +++ src/components/SampleLayout.tsx | 2 +- src/pages/_app.tsx | 4 +++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 1844338c..60a7fa37 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -25,6 +25,7 @@ jobs: - name: Install and Build 🔧 run: | + export REPOSITORY_NAME=${{ github.repository }} npm ci npm run-script lint npm run-script build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index acf19617..4284c4c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,7 @@ jobs: - name: Install and Build 🔧 run: | + export REPOSITORY_NAME=${{ github.repository }} npm ci npm run-script lint npm run-script build diff --git a/next.config.js b/next.config.js index 7880f38e..1c0b93cf 100644 --- a/next.config.js +++ b/next.config.js @@ -54,4 +54,7 @@ module.exports = { return config; }, + env: { + REPOSITORY_NAME: process.env.REPOSITORY_NAME, + }, } diff --git a/src/components/SampleLayout.tsx b/src/components/SampleLayout.tsx index ebba6a49..419ad998 100644 --- a/src/components/SampleLayout.tsx +++ b/src/components/SampleLayout.tsx @@ -161,7 +161,7 @@ const SampleLayout: React.FunctionComponent< See it on Github! diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index c1127977..d41eab45 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -55,7 +55,9 @@ const MainLayout: React.FunctionComponent = ({ >
- Github + + Github +
    {samplesNames.map((slug) => {