Skip to content

Commit

Permalink
Chore(ci): Set fallback url for end2end tests when deploy failes
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Mar 28, 2024
1 parent cf647e0 commit be83367
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
runs-on: ubuntu-22.04
timeout-minutes: 60

env:
NETLIFY_DEPLOY_PREVIEW_URL: 'https://deploy-preview-${{ github.event.pull_request.number }}--spirit-design-system.netlify.app/'

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -64,9 +67,9 @@ jobs:
- name: Run Playwright tests
uses: docker://mcr.microsoft.com/playwright:v1.42.1-jammy
with:
args: WEBSITE_URL="${{ steps.get-netlify-preview-url.outputs.url }}" yarn playwright test
args: yarn playwright test
env:
WEBSITE_URL: ${{ steps.get-netlify-preview-url.outputs.url }}
WEBSITE_URL: ${{ steps.get-netlify-preview-url.outcome == 'success' && steps.get-netlify-preview-url.outputs.url || env.NETLIFY_DEPLOY_PREVIEW_URL }}

- uses: actions/upload-artifact@v4
if: failure()
Expand Down

0 comments on commit be83367

Please sign in to comment.