Skip to content

Commit 51d0c8d

Browse files
authored
ci(deploy): run deploy when a commit is tagged (#16)
* ci(deploy): run deploy when a commit is tagged
1 parent f1520f3 commit 51d0c8d

File tree

1 file changed

+29
-19
lines changed

1 file changed

+29
-19
lines changed

.circleci/config.yml

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,10 @@
44
#
55
version: 2
66
jobs:
7-
deploy:
8-
docker:
9-
# specify the version you desire here
10-
- image: circleci/node:8.11.2
11-
12-
# Specify service dependencies here if necessary
13-
# CircleCI maintains a library of pre-built images
14-
# documented at https://circleci.com/docs/2.0/circleci-images/
15-
# - image: circleci/mongo:3.4.4
16-
working_directory: ~/repo
17-
steps:
18-
- attach_workspace:
19-
at: ~/repo
20-
- run:
21-
name: Authenticate with registry
22-
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
23-
- run:
24-
name: Publish package
25-
command: npm publish
267
build:
8+
filters:
9+
tags:
10+
only: /^v.*/
2711
docker:
2812
# specify the version you desire here
2913
- image: circleci/node:8.11.2
@@ -54,3 +38,29 @@ jobs:
5438

5539
# run build!
5640
- run: yarn build
41+
deploy:
42+
requires:
43+
- build
44+
filters:
45+
tags:
46+
only: /^v.*/
47+
branches:
48+
ignore: /.*/
49+
docker:
50+
# specify the version you desire here
51+
- image: circleci/node:8.11.2
52+
53+
# Specify service dependencies here if necessary
54+
# CircleCI maintains a library of pre-built images
55+
# documented at https://circleci.com/docs/2.0/circleci-images/
56+
# - image: circleci/mongo:3.4.4
57+
working_directory: ~/repo
58+
steps:
59+
- attach_workspace:
60+
at: ~/repo
61+
- run:
62+
name: Authenticate with registry
63+
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
64+
- run:
65+
name: Publish package
66+
command: npm publish

0 commit comments

Comments
 (0)