2022-07-23 00:39:50 +00:00
|
|
|
# .github/workflows/chromatic.yml
|
|
|
|
|
|
|
|
# Workflow name
|
|
|
|
name: 'Chromatic'
|
|
|
|
|
|
|
|
# Event for the workflow
|
2022-07-26 16:19:53 +00:00
|
|
|
on:
|
2022-10-31 13:58:47 +00:00
|
|
|
pull_request: # So we can test on forks
|
2022-07-26 16:19:53 +00:00
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths:
|
|
|
|
- apps/storybook/**
|
|
|
|
- packages/ui/**
|
|
|
|
workflow_dispatch:
|
2022-09-08 17:01:47 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-07-23 00:39:50 +00:00
|
|
|
|
|
|
|
# List of jobs
|
|
|
|
jobs:
|
|
|
|
chromatic-deployment:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2022-07-26 16:19:53 +00:00
|
|
|
ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks
|
2022-07-27 19:50:10 +00:00
|
|
|
fetch-depth: 0
|
2022-07-23 00:39:50 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: yarn
|
|
|
|
# 👇 Adds Chromatic as a step in the workflow
|
|
|
|
- name: Publish to Chromatic
|
|
|
|
uses: chromaui/action@v1
|
|
|
|
# Options required to the GitHub Chromatic Action
|
|
|
|
with:
|
|
|
|
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
|
|
|
|
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
|
2022-07-27 11:02:20 +00:00
|
|
|
workingDir: "apps/storybook"
|
|
|
|
buildScriptName: "build"
|