@@ -6,18 +6,8 @@ name: Chromatic Publish and Testing
6
6
# Event for the workflow
7
7
on :
8
8
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]
21
11
22
12
# List of jobs
23
13
jobs :
@@ -26,28 +16,36 @@ jobs:
26
16
runs-on : ubuntu-latest
27
17
# Job steps
28
18
steps :
29
- # 👇 Version 2 of the action
30
19
- name : Checkout repo
31
- uses : actions/checkout@v2
20
+ uses : actions/checkout@v4
32
21
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
+
34
30
- name : Setup pnpm
35
31
uses : pnpm/action-setup@v2
36
32
with :
37
33
version : 8
34
+
38
35
- name : Setup Node.js
39
36
uses : actions/setup-node@v3
40
37
with :
41
38
node-version : 20
42
- cache : ' pnpm'
39
+ cache : " pnpm"
40
+
43
41
- name : Install deps
44
- # 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
45
42
run : pnpm install
43
+
46
44
- name : Publish to Chromatic
47
- # 👇 Adds Chromatic as a step in the workflow
48
45
uses : chromaui/action@v1
49
- # Options required for Chromatic's GitHub Action
50
46
with :
51
47
projectToken : fee8e66c9916
52
48
# 👇 Only fail if Storybook contains stories that error
53
49
exitZeroOnChanges : true
50
+ onlyChanged : true # enables TurboSnap
51
+ zip : true
0 commit comments