-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 1.78 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
name: Chromatic
on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
paths:
- apps/web/**
- packages/ui/**
# List of jobs
jobs:
chromatic-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-build-${{ env.cache-name }}-
# ${{ runner.os }}-build-
# ${{ runner.os }}-
- if: steps.npm-cache.outputs.cache-hit == 'true'
run: echo 'npm cache hit!'
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: echo 'npm cache missed!'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build:packages
- name: Publish to Chromatic
uses: chromaui/action@v1
id: chromatic
with:
workingDir: apps/web
exitZeroOnChanges: true
skip: dependabot/**
projectToken: chpt_e6e5c08f47b0947
- name: Save PR number and Chromatic build outputs
run: |
mkdir -p ./pr
echo "${{ github.event.pull_request.number }}" > ./pr/prNumber
echo "${{ steps.chromatic.outputs.storybookUrl }}" > ./pr/storybookUrl
echo "${{ steps.chromatic.outputs.buildUrl }}" > ./pr/buildUrl
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: pr
path: pr/