-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (83 loc) · 2.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Workflow name
name: "Chromatic"
# Event for the workflow
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- main
# List of jobs
jobs:
# JOB to run change detection
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
ui: ${{ steps.filter.outputs.ui }}
studio: ${{ steps.filter.outputs.studio }}
steps:
- uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
ui:
- 'packages/components/**'
studio:
- 'apps/studio/**'
ui:
needs: changes
# Only run if the user is not a bot and has changes
if: ${{ !endsWith(github.actor , 'bot') && !endsWith(github.actor, '[bot]') && needs.changes.outputs.ui == 'true' }}
# Operating System
runs-on: ubuntu-latest
environment: staging
# Job steps
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for v4
- name: Setup
uses: ./tooling/github/setup
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@latest
# Chromatic GitHub Action options
with:
workingDir: packages/components
storybookBaseDir: packages/components
projectToken: ${{ secrets.CHROMATIC_COMPONENTS_PROJECT_TOKEN }}
onlyChanged: true
exitOnceUploaded: true
autoAcceptChanges: main
# Skip running Chromatic on dependabot PRs
skip: dependabot/**
studio:
needs: changes
# Only run if the user is not a bot and has changes
if: ${{ !endsWith(github.actor , 'bot') && !endsWith(github.actor, '[bot]') && needs.changes.outputs.studio == 'true' }}
# Operating System
runs-on: ubuntu-latest
environment: staging
# Job steps
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for v4
- name: Setup
uses: ./tooling/github/setup
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@latest
# Chromatic GitHub Action options
with:
workingDir: apps/studio
storybookBaseDir: apps/studio
projectToken: ${{ secrets.CHROMATIC_STUDIO_PROJECT_TOKEN }}
onlyChanged: true
exitOnceUploaded: true
autoAcceptChanges: main
# Skip running Chromatic on dependabot PRs
skip: dependabot/**