Skip to content

Commit df8ae24

Browse files
authored
Merge pull request #159 from auth0/ci-update
Add automated deploy to CI/CD config
2 parents 0357fe5 + 9b1dc69 commit df8ae24

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

.circleci/config.yml

+41-5
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
44
#
55
version: 2
6-
jobs:
7-
build:
8-
docker:
9-
- image: circleci/node:8.12
106

11-
working_directory: ~/repo
7+
defaults: &defaults
8+
working_directory: ~/repo
9+
docker:
10+
- image: circleci/node:8.12
11+
12+
jobs:
13+
test:
14+
<<: *defaults
1215

1316
steps:
1417
- checkout
@@ -45,3 +48,36 @@ jobs:
4548

4649
# run tests!
4750
- run: npm test
51+
deploy:
52+
<<: *defaults
53+
steps:
54+
- attach_workspace:
55+
at: ~/repo
56+
- run:
57+
name: Authenticate with registry
58+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
59+
- run:
60+
name: Publish package
61+
command: npm publish
62+
workflows:
63+
version: 2
64+
test:
65+
jobs:
66+
- test
67+
test_and_deploy:
68+
jobs:
69+
- test:
70+
# only runs when commit with tag in /^v.*/ pattern
71+
filters:
72+
tags:
73+
only: /^v.*/
74+
branches:
75+
only: master
76+
- deploy:
77+
requires:
78+
- test
79+
filters:
80+
branches:
81+
ignore: /.*/
82+
tags:
83+
only: /^v.*/

0 commit comments

Comments
 (0)