Skip to content

Commit

Permalink
INIT optional pathPrefix fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lencodes committed Sep 12, 2023
1 parent fcbb35d commit 09fcbbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/woo-page-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand All @@ -34,6 +38,7 @@ jobs:
uses: SpicyPizza/[email protected]
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 }}
Expand Down
4 changes: 3 additions & 1 deletion pwa/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`,
Expand Down

0 comments on commit 09fcbbd

Please sign in to comment.