generated from Dhaiwat10/react-library-starter
-
Notifications
You must be signed in to change notification settings - Fork 151
41 lines (39 loc) · 1.07 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-lint-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
- name: Restore node modules cache
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies
run: yarn install
- name: Lint code
run: yarn lint
- name: Test code
run: yarn test
- name: Build
run: yarn build
- name: Publish to Chromatic
uses: chromaui/action@v1
# don't run this step if project token secret not specified
# to prevent this workflow failing for any forked repositories
if: ${{ env.CHROMATIC_PROJECT_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}