Skip to content

Run Chromatic on PRs, update GitHub Actions + Dependabot #805

Run Chromatic on PRs, update GitHub Actions + Dependabot

Run Chromatic on PRs, update GitHub Actions + Dependabot #805

Workflow file for this run

name: CI Build
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
env:
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.ref }}
CHROMATIC_SLUG: ${{ github.repository }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Enable corepack
run: corepack enable
- name: Set up Node.js
uses: actions/setup-node@v5
with:
cache: yarn
node-version-file: .nvmrc
- name: Yarn Install
run: yarn
- name: Lint
run: yarn lint
- name: Jest Tests
run: yarn test --coverage
- name: Typescript build
run: yarn build
- name: Storybook build
run: yarn build-storybook
- name: Switch to PR branch SHA
if: ${{ github.event.pull_request }}
run: git switch --detach $CHROMATIC_SHA
- name: Storybook deploy
uses: chromaui/action@v11
with:
autoAcceptChanges: main
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}