-
Notifications
You must be signed in to change notification settings - Fork 47
72 lines (63 loc) · 2.09 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Chromatic
on:
push:
branches:
- main
pull_request:
paths:
- packages/bezier-react/**
- packages/bezier-tokens/**
- packages/bezier-icons/**
jobs:
chromatic-deployment:
if: github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'ch-builder'
name: Chromatic
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# By default checkout action checkouts to merge commit on pull_request event
# checkout to the HEAD commit of PR here, because chromatic checkouts to HEAD commit of PR
# https://www.chromatic.com/docs/turbosnap#github-pullrequest-triggers
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- name: Restore cache
uses: actions/cache@v4
with:
path: |
**/.turbo
node_modules/.cache/turbo
key: ${{ runner.os }}-chromatic-${{ github.sha }}
restore-keys: |
${{ runner.os }}-chromatic-
- name: Install dependencies
run: yarn
- name: Build bezier-react's dependencies
run: yarn build [email protected]/bezier-react^...
- name: Publish to Chromatic
uses: chromaui/action@v11
id: chromatic
with:
workingDir: packages/bezier-react
exitZeroOnChanges: true
autoAcceptChanges: true
onlyChanged: true
skip: dependabot/**
projectToken: 06157a6fbe6f
- name: Save PR number and Chromatic build outputs
run: |
mkdir -p ./pr
echo "${{ github.event.pull_request.number }}" > ./pr/prNumber
echo "${{ steps.chromatic.outputs.storybookUrl }}" > ./pr/storybookUrl
echo "${{ steps.chromatic.outputs.buildUrl }}" > ./pr/buildUrl
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pr
path: pr/