-
Notifications
You must be signed in to change notification settings - Fork 209
58 lines (51 loc) · 1.77 KB
/
chromatic-vrt.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
name: Visual regression testing with Chromatic
on:
workflow_dispatch:
workflow_call:
inputs:
skip:
description: 'Skip running VRT'
required: false
type: boolean
default: false
outputs:
storybook-url:
description: 'URL of the published Storybook'
value: ${{ jobs.vrt.outputs.storybook-url }}
permissions:
contents: read
pull-requests: write
jobs:
vrt:
name: Chromatic
runs-on: ubuntu-latest
timeout-minutes: 20
outputs:
storybook-url: ${{ steps.chromatic.outputs.storybookUrl != 'undefined' && steps.chromatic.outputs.storybookUrl || '' }}
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: yarn --immutable
- name: Publish to Chromatic
id: chromatic
uses: chromaui/action@v11
with:
projectToken: ${{ secrets.CHROMATIC_TOKEN }}
buildScriptName: storybook:build
storybookConfigDir: storybook
exitOnceUploaded: true
onlyChanged: true
traceChanged: true
untraced: '.github/actions/*/package.json'
diagnostics: true
# Lets VRT pass without running so as not to waste snapshots
skip: ${{ inputs.skip }}