Storybook CI/CD Staging
Overview
The Storybook staging workflow runs on pull requests when the orchestrator detects that @kartuli/storybook is affected (Turbo build affected vs origin/main). It builds Storybook, starts the preview server, and runs E2E smoke tests.
Workflow file: staging-w-tool-storybook.yml
Triggers
- Pull request targeting
main: the Staging Orchestrator runs, detects affected packages viaturbo run build --dry=json --affected, and calls the Storybook staging workflow when@kartuli/storybookis in the affected set. - Paths that can affect Storybook include:
tools/storybook/**, shared packages (e.g.packages/ui/**),package.json,pnpm-lock.yaml,turbo.json, and the workflow file itself. - workflow_dispatch for manual runs.
Pipeline steps
- Checkout, CI setup (Node, dependencies).
- Validate monorepo package for
storybook. - Build:
pnpm turbo run build --filter=@kartuli/storybook. - Start preview server in background (port 6006).
- Setup Playwright, run E2E:
pnpm --filter @kartuli/e2e exec playwright test tests/storybookwithBASE_URL=http://localhost:6006. - On E2E failure: upload E2E artifacts.