On WDS PR's merge, we need to create a build for the release branch too so that chromatic baselines is updated. This PR updates the workflow to start a build on merge too. Also, we can now remove build-storybook workflow as that is not needed anymore since we will be building chroamtic on release also. We can use `https://release--5f1e6db0ad879d0022744996.chromatic.com` to see the storybook for release branch.
49 lines
1.3 KiB
YAML
49 lines
1.3 KiB
YAML
name: 'Build Storybook Preview and Publish to Chromatic'
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- release
|
|
paths:
|
|
- 'app/client/packages/design-system/**'
|
|
pull_request:
|
|
paths:
|
|
- 'app/client/packages/design-system/**'
|
|
|
|
jobs:
|
|
chromatic-deployment:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout PR if pull_request event
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: refs/pull/${{ github.event.pull_request.number }}/merge
|
|
|
|
- name: Checkout PR if push event
|
|
if: github.event_name == 'push'
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 0
|
|
ref: release
|
|
|
|
- name: Use Node.js 16.14.0
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: "16.14.0"
|
|
|
|
- name: Install Dependencies
|
|
working-directory: ./app/client/packages/storybook
|
|
run: yarn install --immutable
|
|
|
|
- name: Publish to Chromatic
|
|
id: chromatic-publish
|
|
uses: chromaui/action@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
|
workingDir: ./app/client/packages/storybook
|
|
exitOnceUploaded: true
|