-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (51 loc) · 1.62 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
name: "Chromatic"
on:
workflow_dispatch:
pull_request:
types:
- synchronize
- labeled
push:
branches:
- main
jobs:
chromatic:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'chromatic') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: ASDF cache
uses: actions/cache@v4
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
id: asdf-cache
# only run `asdf install` if we didn't hit the cache
- uses: asdf-vm/actions/install@v1
if: steps.asdf-cache.outputs.cache-hit != 'true'
- name: Setup ASDF environment
run: |
ASDF_DIR=$HOME/.asdf
echo "ASDF_DIR=$ASDF_DIR" >> $GITHUB_ENV
echo "ASDF_DATA_DIR=$ASDF_DIR" >> $GITHUB_ENV
echo "$ASDF_DIR/bin" >> $GITHUB_PATH
echo "$ASDF_DIR/shims" >> $GITHUB_PATH
$ASDF_DIR/bin/asdf reshim
- name: Restore dependencies cache
id: deps-cache
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
restore-keys: ${{ runner.os }}-mix-
- name: Install dependencies
run: pushd assets && npm i && popd
- name: Publish to Chromatic
uses: chromaui/action@v1
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: assets/
exitZeroOnChanges: true