-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (43 loc) · 1.39 KB
/
ci.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
name: 'CI'
on: push
env:
NODE_VERSION: '18.12.1'
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Check code format
run: npm run prettier:check
- name: Check code format
run: npm run eslint
chromatic-deployment:
# Operating System
runs-on: ubuntu-latest
# Job steps
env:
HAS_CHROMATIC_PROJECT_TOKEN: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Setup Node ${{ env.NODE_VERSION }} Environment
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: Install dependencies
if: ${{ env.HAS_CHROMATIC_PROJECT_TOKEN }}
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
run: npm ci
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
if: ${{ env.HAS_CHROMATIC_PROJECT_TOKEN }}
uses: chromaui/action-next@v1
# Chromatic GitHub Action options
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}