1 | version: 2
|
2 | jobs:
|
3 | build:
|
4 | working_directory: /usr/src/app
|
5 | docker:
|
6 | - image: banian/node
|
7 | steps:
|
8 |
|
9 | - checkout
|
10 |
|
11 |
|
12 | - restore_cache:
|
13 | key: yarn-{{ checksum "yarn.lock" }}
|
14 |
|
15 |
|
16 | - run:
|
17 | name: Install Dependencies
|
18 | command: NODE_ENV=dev yarn
|
19 |
|
20 |
|
21 | - save_cache:
|
22 | key: yarn-{{ checksum "yarn.lock" }}
|
23 | paths:
|
24 | - "node_modules"
|
25 |
|
26 | - run:
|
27 | name: Tests
|
28 | command: yarn test
|
29 |
|
30 |
|
31 | - run:
|
32 | name: Build
|
33 | command: |
|
34 | yarn ks-generate
|
35 |
|
36 | # Deploy
|
37 | - deploy:
|
38 | name: Surge
|
39 | command: |
|
40 | if [ "${CIRCLE_BRANCH}" == "master" ]; then
|
41 | yarn surge
|
42 | fi
|
43 |
|
\ | No newline at end of file |