Skip to content

Commit f627d5d

Browse files
committed
Add Chromatic workflow
1 parent 7bb4204 commit f627d5d

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/chromatic.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Chromatic recommend having this on "push" so we have it as a separate workflow
2+
# https://www.chromatic.com/docs/github-actions/#recommended-configuration-for-build-events
3+
4+
name: "Chromatic"
5+
6+
on: push
7+
8+
jobs:
9+
chromatic:
10+
name: Run Chromatic
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
- name: Install dependencies
21+
run: npm ci
22+
- name: Run Chromatic
23+
uses: chromaui/action@latest
24+
with:
25+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"test": "jest --env=jsdom",
1010
"build": "ROLLUP_WATCH=false rollup -c --bundleConfigAsCjs",
1111
"storybook": "storybook dev -p 6006",
12+
"chromatic": "chromatic --exit-zero-on-changes",
1213
"build-storybook": "storybook build",
1314
"prettier:check": "prettier --check .",
1415
"prettier:write": "prettier --write ."

0 commit comments

Comments
 (0)