From 54364dd07de9a7d9ccc464ddae339fe333c0b800 Mon Sep 17 00:00:00 2001 From: Mikael Brevik Date: Thu, 29 Feb 2024 15:00:09 +0100 Subject: [PATCH] chore: trigger playwright on deployment state (#244) --- .github/workflows/playwright.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml index c08d20eb..90e659bd 100644 --- a/.github/workflows/playwright.yml +++ b/.github/workflows/playwright.yml @@ -1,9 +1,14 @@ name: Playwright Tests on: - pull_request: - branches: main + deployment_status: + jobs: test: + if: + github.event_name == 'deployment_status' && + github.event.deployment_status.state == 'success' && + endsWith(github.event.deployment.environment, 'Preview') + timeout-minutes: 60 runs-on: ubuntu-latest steps: @@ -19,18 +24,11 @@ jobs: - name: Install Playwright Browsers run: yarn playwright install --with-deps - - name: Waiting for 200 from the Vercel Preview - uses: patrickedqvist/wait-for-vercel-preview@v1.3.1 - id: waitFor200 - with: - token: ${{ secrets.GITHUB_TOKEN }} - check_interval: 10 - max_timeout: 120 - name: Run Playwright tests run: yarn playwright test env: NEXT_PUBLIC_PLANNER_ORG_ID: atb - E2E_URL: ${{ steps.waitFor200.outputs.url }} + E2E_URL: ${{ github.event.deployment_status.target_url }} - uses: actions/upload-artifact@v4 if: always()