Skip to content

Commit 2fc3823

Browse files
authored
Merge pull request #21 from clarivate/circleci-project-setup
Circleci project setup
2 parents 0d12f19 + 87ae8c4 commit 2fc3823

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.circleci/config.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Javascript Node CircleCI 2.0 configuration file
2+
#
3+
# Check {{ '/2.0/language-javascript/' | docs_url }} for more details
4+
#
5+
version: 2
6+
7+
defaults: &defaults
8+
working_directory: ~/repo
9+
docker:
10+
- image: circleci/node:10.13
11+
12+
jobs:
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:
26+
name: Run tests
27+
command: echo 'noop'
28+
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: Build the package
44+
command: ng build angular-image-viewer --prod
45+
- run:
46+
name: Authenticate with registry
47+
command: echo "//registry.npmjs.org/:_authToken=$npm_TOKEN" > ~/repo/.npmrc
48+
- run:
49+
name: Publish package
50+
command: npm publish dist/angular-image-viewer/
51+
52+
workflows:
53+
version: 2
54+
test-deploy:
55+
jobs:
56+
- test:
57+
filters:
58+
tags:
59+
only: /^v.*/
60+
- deploy:
61+
requires:
62+
- test
63+
filters:
64+
tags:
65+
only: /^v.*/
66+
branches:
67+
ignore: /.*/

0 commit comments

Comments
 (0)