Skip to content

Commit

Permalink
Chore(ci): Fix usage of env variables in e2e pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Apr 2, 2024
1 parent e5d42cd commit 1b7e95a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:

env:
NODE_ENV: testing
PR_NUMBER: ${{ github.event.pull_request.number }}
NETLIFY_MAIN_URL: 'https://spirit-design-system.netlify.app/'

jobs:
haslabel:
Expand All @@ -36,10 +38,7 @@ jobs:
timeout-minutes: 60

env:
NETLIFY_MAIN_URL: 'https://spirit-design-system.netlify.app/'
NETLIFY_DEPLOY_PREVIEW_URL: 'https://deploy-preview-${{ github.event.pull_request.number }}--spirit-design-system.netlify.app/'
# fallback to main url if the main branch is deployed
NETLIFY_DEPLOYED_URL: ${{ github.event.pull_request.number && env.NETLIFY_DEPLOY_PREVIEW_URL || env.NETLIFY_MAIN_URL }}
NETLIFY_DEPLOY_PREVIEW_URL: 'https://deploy-preview-$PR_NUMBER--spirit-design-system.netlify.app/'

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -72,6 +71,8 @@ jobs:
with:
args: yarn playwright test
env:
# fallback to main url if the main branch is deployed
NETLIFY_DEPLOYED_URL: ${{ env.PR_NUMBER && env.NETLIFY_DEPLOY_PREVIEW_URL || env.NETLIFY_MAIN_URL }}
WEBSITE_URL: ${{ steps.get-netlify-preview-url.outcome == 'success' && steps.get-netlify-preview-url.outputs.url || env.NETLIFY_DEPLOYED_URL }}

- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 1b7e95a

Please sign in to comment.