-
Notifications
You must be signed in to change notification settings - Fork 55
64 lines (55 loc) · 1.59 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
name: Chromatic
on:
workflow_dispatch:
pull_request:
branches:
- "**"
paths:
- "frontend/**"
push:
branches:
- main
paths:
- "frontend/**"
env:
NODE_VERSION: 18
jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Chromatic wants the history
- uses: actions/[email protected]
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: yarn
working-directory: frontend
- name: Publish to Chromatic
if: github.ref != 'refs/heads/main'
uses: chromaui/action@v1
with:
workingDir: frontend
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
ignoreLastBuildOnBranch: "**" # Better comparisons after rebasing
exitZeroOnChanges: true
exitOnceUploaded: true
- name: Publish to Chromatic (auto-accept changes on merge main)
if: github.ref == 'refs/heads/main'
uses: chromaui/action@v1
with:
workingDir: frontend
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
ignoreLastBuildOnBranch: "**"
exitZeroOnChanges: true
exitOnceUploaded: true
autoAcceptChanges: true # handle squash-on-merge
- name: Artifact Chromatic logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: logs
path: frontend/*.log