diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index cb3c9589..5629258f 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -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: diff --git a/scripts/ci/copy-env-vars-to-dot-env-file b/scripts/ci/copy-env-vars-to-dot-env-file new file mode 100755 index 00000000..f6b52ef8 --- /dev/null +++ b/scripts/ci/copy-env-vars-to-dot-env-file @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +echo "NUXT_PUBLIC_R_API_BASE=$NUXT_PUBLIC_R_API_BASE" > .env