Skip to content

[pull] master from backstage:master #2177

[pull] master from backstage:master

[pull] master from backstage:master #2177

name: Storybook
on:
# NOTE: If you change these you must update verify_storybook-noop.yml as well
pull_request:
paths:
- '.github/workflows/verify_storybook.yml'
- 'storybook/**'
- 'packages/config/src/**'
- 'packages/theme/src/**'
- 'packages/types/src/**'
- 'packages/errors/src/**'
- 'packages/version-bridge/src/**'
- 'packages/test-utils/src/**'
- 'packages/core-app-api/src/**'
- 'packages/core-plugin-api/src/**'
- 'packages/core-components/src/**'
- '**/*.stories.tsx'
jobs:
chromatic:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [20.x]
name: Storybook
steps:
- name: Harden Runner
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
with:
egress-policy: audit
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0 # Required to retrieve git history
- name: use node.js ${{ matrix.node-version }}
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/ # Needed for auth
- name: yarn install
uses: backstage/actions/yarn-install@b3c1841fd69e1658ac631afafd0fb140a2309024 # v0.6.17
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}
- name: storybook yarn install
run: yarn install --immutable
working-directory: storybook
# Only for verification, the canon one is what we upload to Chromatic
- run: yarn build-storybook
- run: yarn --cwd packages/canon build-storybook
- uses: chromaui/action@1fc59b137c52d2f7571c8cf0b40daad2794fd551 # v11
with:
token: ${{ secrets.GITHUB_TOKEN }}
# projectToken intentionally shared to allow collaborators to run Chromatic on forks
# https://www.chromatic.com/docs/custom-ci-provider#run-chromatic-on-external-forks-of-open-source-projects
projectToken: chpt_dab72dc0f97d55b
workingDir: packages/canon
storybookBuildDir: storybook-static