-
Notifications
You must be signed in to change notification settings - Fork 321
29 lines (27 loc) · 1.06 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
name: "Chromatic"
on: push
jobs:
chromatic-deployment:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: yarn
- name: Check if there are changed packages
id: changed-packages
continue-on-error: true
run: |
changed_packages=$(yarn -s lerna ls --since=origin/master --json --loglevel=error)
[[ $changed_packages = "[]" ]] && echo "HAS_CHANGES=false" >> $GITHUB_ENV || echo "HAS_CHANGES=true" >> $GITHUB_ENV
- name: Run Build
if: ${{ env.HAS_CHANGES == 'true' }}
shell: bash
run: yarn lerna run build --since=origin/master --include-filtered-dependencies
- name: Publish to Chromatic
uses: chromaui/action@v1
if: ${{ env.HAS_CHANGES == 'true' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
# 👇 Chromatic projectToken, if you are project maintainer refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: packages/core