Skip to content

Commit

Permalink
ci: add PUBLIC_PATH to env
Browse files Browse the repository at this point in the history
  • Loading branch information
qinsong77 committed Jan 4, 2024
1 parent 53b11f3 commit 4e70702
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
cache-and-install:
runs-on: ubuntu-latest

env:
PUBLIC_PATH: webpack5-react-template

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -19,6 +22,9 @@ jobs:
with:
node-version: 18

- name: Set Environment Variables
run: echo "PUBLIC_PATH=${{ env.PUBLIC_PATH }}" >> $GITHUB_ENV

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
Expand Down
2 changes: 1 addition & 1 deletion webpack/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ loadConfig({
path: ENV_CONFIG_PATH,
})

export const PUBLIC_PATH = '/'
export const PUBLIC_PATH = process.env.PUBLIC_PATH ?? '/'

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand Down

0 comments on commit 4e70702

Please sign in to comment.