Skip to content

Commit 9b32aad

Browse files
committed
setup new chromatic ci config
1 parent e9897a6 commit 9b32aad

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

.github/workflows/chromatic.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,8 @@ name: Chromatic Publish and Testing
66
# Event for the workflow
77
on:
88
pull_request:
9-
types:
10-
- opened
11-
- synchronize
12-
- ready_for_review
13-
paths:
14-
# Only run on file changes in any of these paths
15-
- "src/components/**/*"
16-
- "src/pages/**/*"
17-
- "src/layouts/**/*"
18-
- ".storybook/**/*"
19-
- "tailwind.config.ts"
20-
- "src/styles/**/*"
9+
branches: [master, staging, "test/**"]
10+
types: [opened, synchronize, ready_for_review]
2111

2212
# List of jobs
2313
jobs:
@@ -26,28 +16,36 @@ jobs:
2616
runs-on: ubuntu-latest
2717
# Job steps
2818
steps:
29-
# 👇 Version 2 of the action
3019
- name: Checkout repo
31-
uses: actions/checkout@v2
20+
uses: actions/checkout@v4
3221
with:
33-
fetch-depth: 0 # 👈 Required to retrieve git history
22+
fetch-depth: 0
23+
# Tells the checkout which commit hash to reference
24+
ref: ${{ github.event.pull_request.head.ref }}
25+
env:
26+
CHROMATIC_BRANCH: ${{ github.event.pull_request.head.ref || github.ref_name }}
27+
CHROMATIC_SHA: ${{ github.event.pull_request.head.sha || github.ref }}
28+
CHROMATIC_SLUG: ${{ github.repository }}
29+
3430
- name: Setup pnpm
3531
uses: pnpm/action-setup@v2
3632
with:
3733
version: 8
34+
3835
- name: Setup Node.js
3936
uses: actions/setup-node@v3
4037
with:
4138
node-version: 20
42-
cache: 'pnpm'
39+
cache: "pnpm"
40+
4341
- name: Install deps
44-
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
4542
run: pnpm install
43+
4644
- name: Publish to Chromatic
47-
# 👇 Adds Chromatic as a step in the workflow
4845
uses: chromaui/action@v1
49-
# Options required for Chromatic's GitHub Action
5046
with:
5147
projectToken: fee8e66c9916
5248
# 👇 Only fail if Storybook contains stories that error
5349
exitZeroOnChanges: true
50+
onlyChanged: true # enables TurboSnap
51+
zip: true

0 commit comments

Comments
 (0)