Skip to content

Storybook Tests After Deployment #4

Storybook Tests After Deployment

Storybook Tests After Deployment #4

name: Storybook Tests After Deployment
on: deployment_status # deployment_status is triggered when a deployment is created or updated, for example on vercel, and you can get the URL from there
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
if: github.event.deployment_status.state == 'success'
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- name: Install dependencies
run: pnpm install
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run Storybook tests
run: pnpm test
env:
TARGET_URL: "${{ github.event.deployment_status.target_url }}"