-
Notifications
You must be signed in to change notification settings - Fork 6
55 lines (49 loc) · 1.72 KB
/
chromatic.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Name of our action
name: 'Chromatic'
# The event that will trigger the action
on:
pull_request:
branches:
- main
# What the action will do
jobs:
test:
# The operating system it will run on
runs-on: ubuntu-latest
outputs:
status: ${{ job.status }}
# The list of steps that the action will go through
steps:
- name: checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn
#👇 Adds Chromatic as a step in the workflow
- name: publish to chromatic
uses: chromaui/action@v1
# Options required for Chromatic's GitHub Action
id: chromatic
with:
#👇 Chromatic projectToken, see https://storybook.js.org/tutorials/design-systems-for-developers/react/ko/review/ to obtain it
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
#onlyChanged: true
exitZeroOnChanges: true
autoAcceptChanges: true
- name: comment PR
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: '🚀storybook: ${{ steps.chromatic.outputs.storybookUrl }}'