Skip to content

Commit

Permalink
Replace VITE_* env vars at build time (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
markwaddle authored Sep 30, 2024
1 parent 69a5c1a commit 65411b0
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/workbench-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:
workflow_dispatch:

jobs:
build:
build-pr:
runs-on: ubuntu-latest

steps:
Expand All @@ -39,6 +39,31 @@ jobs:
env:
NODE_OPTIONS: "--max_old_space_size=8192"

build-main:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
environment:
name: production

steps:
- uses: actions/checkout@v4

- name: Set up Node.js version
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: npm install, build, and test
run: |
npm install
npm run build --if-present
npm run test --if-present
working-directory: ./workbench-app
env:
NODE_OPTIONS: "--max_old_space_size=8192"
VITE_SEMANTIC_WORKBENCH_AUTHORITY: ${{ secrets.VITE_SEMANTIC_WORKBENCH_AUTHORITY }}
VITE_SEMANTIC_WORKBENCH_CLIENT_ID: ${{ secrets.VITE_SEMANTIC_WORKBENCH_CLIENT_ID }}

- name: Zip artifact for deployment
if: github.event_name != 'pull_request'
run: zip semantic-workbench-release.zip . -r
Expand All @@ -54,7 +79,7 @@ jobs:
deploy:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
needs: build
needs: build-main
environment:
name: production
permissions:
Expand Down

0 comments on commit 65411b0

Please sign in to comment.