Skip to content

chore(deps): bump the non-critical group across 1 directory with 12 u… #18

chore(deps): bump the non-critical group across 1 directory with 12 u…

chore(deps): bump the non-critical group across 1 directory with 12 u… #18

Workflow file for this run

name: Storybook CI

Check failure on line 1 in .github/workflows/storybook-ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/storybook-ci.yml

Invalid workflow file

(Line: 90, Col: 9): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.CHROMATIC_PROJECT_TOKEN != ''
on:
push:
branches: [main]
paths:
- 'frontend/src/**'
- 'frontend/.storybook/**'
- 'frontend/package.json'
pull_request:
branches: [main]
paths:
- 'frontend/src/**'
- 'frontend/.storybook/**'
- 'frontend/package.json'
concurrency:
group: storybook-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Build Storybook ─────────────────────────────────────────────────────────
build:
name: Build Storybook
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Chromatic requires full git history
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
working-directory: .
- name: Build Storybook
run: npm run build-storybook
- name: Upload storybook-static artifact
uses: actions/upload-artifact@v4
with:
name: storybook-static
path: frontend/storybook-static
retention-days: 7
# ── Publish to GitHub Pages (on main only) ──────────────────────────────────
publish-pages:
name: Publish to GitHub Pages
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download storybook-static artifact
uses: actions/download-artifact@v4
with:
name: storybook-static
path: storybook-static
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
path: storybook-static
- id: deployment
uses: actions/deploy-pages@v4
# ── Chromatic visual regression ─────────────────────────────────────────────
chromatic:
name: Chromatic visual regression
needs: build
runs-on: ubuntu-latest
# Only run when the secret is configured; skip silently otherwise.
if: ${{ secrets.CHROMATIC_PROJECT_TOKEN != '' }}
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
working-directory: .
- name: Run Chromatic
uses: chromaui/action@latest
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: frontend
# Accept all changes on main (baseline updates); flag on PRs.
autoAcceptChanges: ${{ github.ref == 'refs/heads/main' }}
exitZeroOnChanges: true
# Upload the pre-built storybook so Chromatic doesn't rebuild.
storybookBuildDir: storybook-static