-
Notifications
You must be signed in to change notification settings - Fork 30
52 lines (46 loc) · 1.87 KB
/
dcr-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
name: DCR Chromatic 👓
on:
push:
branches: [main]
pull_request:
types: [opened, labeled, synchronize, ready_for_review]
jobs:
chromatic:
name: Chromatic
runs-on: ubuntu-latest
# Don't run Chromatic on draft PRs unless `run_chromatic` label has been applied.
if: (contains(github.event.pull_request.labels.*.name, 'run_chromatic') || github.event.pull_request.draft == false)
steps:
- name: Checkout - On Pull Request
uses: actions/checkout@v4
if: ${{ github.event_name == 'pull_request'}}
with:
fetch-depth: 0
# By default the pull_request event will run on a ephermeral merge commit which simulates a merge between the pull request
# and the target branch. This can cause issues with Chromatic https://www.chromatic.com/docs/turbosnap#github-pullrequest-triggers
# Hopefully by checking out the HEAD commit of a PR instead of the merge commit we can avoid some of those issues.
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout - On Push Event
uses: actions/checkout@v4
if: ${{ github.event_name == 'push'}}
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
# Root yarn installs all workspaces (root, dotcom)
- run: yarn install --immutable
- name: Chromatic - DCR
env:
NODE_OPTIONS: '--max_old_space_size=4096'
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN__DOTCOM_RENDERING }}
token: ${{ secrets.GITHUB_TOKEN }}
autoAcceptChanges: main
onlyChanged: true
untraced: '**/(package*.json|yarn.lock|preview.js)'
workingDir: dotcom-rendering
buildScriptName: 'build-storybook'