Skip to content

Commit

Permalink
Update CircleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
RaeesBhatti committed Jul 24, 2019
1 parent e6c9e49 commit 9337235
Showing 1 changed file with 18 additions and 28 deletions.
46 changes: 18 additions & 28 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,48 @@
version: 2
jobs:
build:
test:
docker:
# specify the version you desire here
- image: circleci/node:8

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4

working_directory: ~/cli

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- npm-dependencies-{{ checksum "npm-shrinkwrap.json" }}
# fallback to using the latest cache if no exact match is found
- npm-dependencies-

- run: npm install

- save_cache:
paths:
- node_modules
key: npm-dependencies-{{ checksum "npm-shrinkwrap.json" }}

# run tests!
- run: npm test

deploy:
docker:
- image: circleci/node:8
working_directory: ~/cli
requires:
- build
filters:
branches:
ignore: /.*/
tags:
only: /.*/
steps:
- checkout
- restore_cache:
keys:
- npm-dependencies-{{ checksum "npm-shrinkwrap.json" }}
- npm-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: npm-dependencies-{{ checksum "npm-shrinkwrap.json" }}
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run: npm publish

workflows:
version: 2
test-n-deploy:
jobs:
- test:
filters: # required since `deploy` has tag filters AND requires `build`
tags:
only: /.*/
- deploy:
requires:
- test
filters:
tags:
only: /.*/
branches:
only: master

0 comments on commit 9337235

Please sign in to comment.