Skip to content

Commit

Permalink
Use script for env vars for github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
david-mears-2 committed Aug 2, 2024
1 parent b382052 commit 8f6b8da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,13 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set environment variables for app (todo - make into a script)
run: echo "NUXT_PUBLIC_R_API_BASE=$NUXT_PUBLIC_R_API_BASE" > .env
- name: Set environment variables for app
run: scripts/ci/copy-env-vars-to-dot-env-file
env:
NUXT_PUBLIC_R_API_BASE: ${{ vars.NUXT_PUBLIC_R_API_BASE }}
- name: print env vars
run: printenv | sort
# Note - non-secret variables are stored under the 'vars' context, while secrets will be stored under the 'secrets' context
- name: print dot env file
run: cat .env
- name: Setup upterm session (for ssh-ing)
uses: lhotari/action-upterm@v1
- name: Set up Node
uses: actions/setup-node@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions scripts/ci/copy-env-vars-to-dot-env-file
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

set -euxo pipefail

echo "NUXT_PUBLIC_R_API_BASE=$NUXT_PUBLIC_R_API_BASE" > .env

0 comments on commit 8f6b8da

Please sign in to comment.