Chromatic #644
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Chromatic | |
on: | |
workflow_run: | |
workflows: [Test] | |
types: [completed] | |
jobs: | |
screenshots: | |
name: Screenshots | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@main | |
with: | |
# This makes Actions fetch all Git history so that chromatic can diff against previous commits | |
fetch-depth: 0 | |
- name: Download artifacts | |
uses: dawidd6/action-download-artifact@v3 | |
with: | |
name: built-storybook | |
path: storybook-static | |
workflow: ${{ github.event.workflow_run.workflow_id }} | |
workflow_conclusion: success | |
- name: Set up pnpm | |
uses: pnpm/action-setup@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@main | |
with: | |
node-version-file: 'package.json' | |
cache: 'pnpm' | |
- name: Install Dependencies | |
run: pnpm i | |
- name: Run Chromatic | |
run: pnpm chromatic --storybook-build-dir storybook-static --exit-zero-on-changes --auto-accept-changes master | |
env: | |
CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_APP_CODE }} | |
CHROMATIC_BRANCH: ${{ github.event.workflow_run.head_repository.owner.login }}:${{ github.event.workflow_run.head_branch }} | |
CHROMATIC_SHA: ${{ github.event.workflow_run.head_sha }} | |
CHROMATIC_SLUG: ${{ github.event.workflow_run.head_repository.full_name }} |