Files
webstudio/.github/workflows/chromatic.yml
T
Mateusz Burzyński 3794f9a497 Add a composed Storybook (#529)
This PR builds on top of the work done in
https://github.com/webstudio-is/webstudio-designer/pull/519 and
introduces a root-level storybook that just aggregates all of the
per-package storybooks into one.

This allows you to have a single, convenient, URL to visit and browse
all of those existing storybooks at once. To access this storybook you
need to click on the `Details` link attached to the "Storybook Publish:
!webstudio-is/webstudio-designer" status check.

The current URL from this branch is available
[here](https://638affb61acca1e593c6e558-dksaophpxa.chromatic.com/) so
you can take a look at how this looks in practice.
2022-12-09 14:46:23 +01:00

90 lines
2.5 KiB
YAML

name: Chromatic
on: [push]
jobs:
chromatic:
timeout-minutes: 20
runs-on: ubuntu-latest
strategy:
matrix:
project:
[designer-app, css-engine, design-system, icons, image, react-sdk]
include:
- project: designer-app
chromaticSecretKey: CHROMATIC_DESIGNER_APP_TOKEN
workingDir: apps/designer
- project: css-engine
chromaticSecretKey: CHROMATIC_CSS_ENGINE_TOKEN
workingDir: packages/css-engine
- project: design-system
chromaticSecretKey: CHROMATIC_DESIGN_SYSTEM_TOKEN
workingDir: packages/design-system
- project: icons
chromaticSecretKey: CHROMATIC_ICONS_TOKEN
workingDir: packages/icons
- project: image
chromaticSecretKey: CHROMATIC_IMAGE_TOKEN
workingDir: packages/image
- project: react-sdk
chromaticSecretKey: CHROMATIC_REACT_SDK_TOKEN
workingDir: packages/react-sdk
outputs:
designer-app: ${{ steps.deployed-url.outputs.designer-app }}
css-engine: ${{ steps.deployed-url.outputs.css-engine }}
design-system: ${{ steps.deployed-url.outputs.design-system }}
icons: ${{ steps.deployed-url.outputs.icons }}
image: ${{ steps.deployed-url.outputs.image }}
react-sdk: ${{ steps.deployed-url.outputs.react-sdk }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2 # we need to fetch at least parent commit to satisfy Chromatic
- uses: ./.github/actions/ci-setup
# only packages have to be built as they might be imported by Storybooks
- run: yarn build --filter='!./apps/*'
- name: Chromatic
id: chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets[matrix.chromaticSecretKey] }}
workingDir: ${{ matrix.workingDir }}
- name: Save deployed URL
id: deployed-url
run: echo "${{ matrix.project }}=${{ steps.chromatic.outputs.storybookUrl }}" >> $GITHUB_OUTPUT
chromatic-root:
timeout-minutes: 20
needs: chromatic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2 # we need to fetch at least parent commit to satisfy Chromatic
- uses: ./.github/actions/ci-setup
- name: Chromatic
id: chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_ROOT }}
env:
DEPLOYED_URLS: ${{ toJSON(needs.chromatic.outputs) }}