From 09fcbbd5e554f2aced2c363a60587128ad328188 Mon Sep 17 00:00:00 2001 From: Lennart Bank Date: Tue, 12 Sep 2023 15:18:56 +0200 Subject: [PATCH 1/2] INIT optional pathPrefix fix --- .github/workflows/woo-page-deploy.yml | 7 ++++++- pwa/gatsby-config.js | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/woo-page-deploy.yml b/.github/workflows/woo-page-deploy.yml index 62da6c9f..b6f6d397 100644 --- a/.github/workflows/woo-page-deploy.yml +++ b/.github/workflows/woo-page-deploy.yml @@ -2,6 +2,10 @@ name: Deploy the Product Page to GitHub Pages env: # Change these to your preferences any image url can also be a base encoded image GITHUB_PAGES_BRANCH: gh-pages + + # options: "true" | "false" + USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX: "true" + GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }} API_BASE_URL: "https://api.gateway.commonground.nu/api" NL_DESIGN_THEME_CLASSNAME: "conduction-theme" @@ -16,7 +20,7 @@ env: # Change these to your preferences any image url can also be a base encoded on: push: branches: - - development + - bugfix/XW-62/woo-template-link jobs: build: @@ -34,6 +38,7 @@ jobs: uses: SpicyPizza/create-envfile@v2.0 with: envkey_GITHUB_REPOSITORY_NAME: ${{ env.GITHUB_REPOSITORY_NAME }} + envkey_USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX: ${{ env.USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX }} envkey_GATSBY_API_BASE_URL: ${{ env.API_BASE_URL }} envkey_GATSBY_NL_DESIGN_THEME_CLASSNAME: ${{ env.NL_DESIGN_THEME_CLASSNAME }} envkey_GATSBY_FAVICON_URL: ${{ env.FAVICON_URL }} diff --git a/pwa/gatsby-config.js b/pwa/gatsby-config.js index 1ab649f8..c3ccec87 100644 --- a/pwa/gatsby-config.js +++ b/pwa/gatsby-config.js @@ -3,7 +3,9 @@ require("dotenv").config({ }); module.exports = { - pathPrefix: `/${process.env.GITHUB_REPOSITORY_NAME}`, + pathPrefix: + process.env.USE_GITHUB_REPOSITORY_NAME_AS_PATH_PREFIX === "true" ?? + `$/${process.env.GITHUB_REPOSITORY_NAME}`, // we do NOT want to set the prefix if we're using an DNS plugins: [ { resolve: `gatsby-plugin-layout`, From 5a7b6e55ab082a4f6853f2b294bb2a8c253fe71e Mon Sep 17 00:00:00 2001 From: Lennart Bank Date: Tue, 12 Sep 2023 15:30:43 +0200 Subject: [PATCH 2/2] REVERT temp chagnes --- .github/workflows/woo-page-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/woo-page-deploy.yml b/.github/workflows/woo-page-deploy.yml index b6f6d397..3d5f16e4 100644 --- a/.github/workflows/woo-page-deploy.yml +++ b/.github/workflows/woo-page-deploy.yml @@ -20,7 +20,7 @@ env: # Change these to your preferences any image url can also be a base encoded on: push: branches: - - bugfix/XW-62/woo-template-link + - development jobs: build: