forked from sudhanshu-15/vue-embed-gist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
circle.yml
59 lines (58 loc) · 1.45 KB
/
circle.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
54
55
56
57
58
59
version: 2
jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/node:latest
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: install dependences
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: test
command: npm run test
- run:
name: build
command: npm run build
publish:
working_directory: ~/repo
docker:
- image: circleci/node:latest
steps:
- checkout
- run:
name: add npm token
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: install dependences
command: npm install
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
- run:
name: publish on npm
command: npm publish
workflows:
version: 2
build-and-publish:
jobs:
- build:
filters:
tags:
ignore: /v[0-9]+(\.[0-9]+)*/
- publish:
filters:
branches:
ignore: /.*/
tags:
only: /v[0-9]+(\.[0-9]+)*/