UNPKG

1.41 kBYAMLView Raw
1# Javascript Node CircleCI 2.0 configuration file
2#
3# Check https://circleci.com/docs/2.0/language-javascript/ for more details
4#
5version: 2
6
7defaults: &defaults
8 working_directory: ~/repo
9 docker:
10 - image: circleci/node:8.9.1
11
12jobs:
13 test:
14 <<: *defaults
15 steps:
16 - checkout
17
18 - restore_cache:
19 keys:
20 - v1-dependencies-{{ checksum "package.json" }}
21# fallback to using the latest cache if no exact match is found
22 - v1-dependencies-
23
24 - run: npm install
25 - run: npm run build
26# - run:
27# name: Run tests
28# command: npm test
29 - save_cache:
30 paths:
31 - node_modules
32 key: v1-dependencies-{{ checksum "package.json" }}
33
34 - persist_to_workspace:
35 root: ~/repo
36 paths: .
37 deploy:
38 <<: *defaults
39 steps:
40 - attach_workspace:
41 at: ~/repo
42 - run:
43 name: Authenticate with registry
44 command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
45 - run: cat .npmrc
46 - run:
47 name: Publish package
48 command: npm publish
49
50workflows:
51 version: 2
52 test-deploy:
53 jobs:
54 - test:
55 filters:
56 tags:
57 only: /^v.*/
58 - deploy:
59 context: troven
60 requires:
61 - test
62 filters:
63 tags:
64 only: /^v.*/