Skip to content

Commit

Permalink
fix(gh action): run for specific URLs & pass deployment URL as env var
Browse files Browse the repository at this point in the history
  • Loading branch information
BrickheadJohnny committed Jul 23, 2024
1 parent 1bf45f9 commit 157a275
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
deployment_status:
jobs:
test:
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success'
if: github.event_name == 'deployment_status' && github.event.deployment_status.state == 'success' && contains(github.event.deployment_status.deployment_url, "storybook")
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
Expand All @@ -14,6 +14,8 @@ jobs:
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
env:
DEPLOYMENT_URL: ${{ github.event.deployment_status.deployment_url }}
run: npm run test
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig, devices } from "@playwright/test"

const baseURL = "http://localhost:3000"
const baseURL = process.env.DEPLOYMENT_URL || "http://localhost:3000"

export default defineConfig({

Check warning on line 5 in playwright.config.ts

View workflow job for this annotation

GitHub Actions / quality-assurance

lint/style/noDefaultExport

Avoid default exports.
testDir: "./playwright",
Expand Down

0 comments on commit 157a275

Please sign in to comment.