aboutsummaryrefslogtreecommitdiff
path: root/.circleci
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-03-21 18:06:17 +0300
committereug-vs <eug-vs@keemail.me>2020-03-21 18:06:17 +0300
commite894e21956d8cfd0045125581f04291639d781ae (patch)
treed6e1e614e3c5d4b3ecd72027fffed348ac549725 /.circleci
parent8e48a481be6fdcb6c4ff926165379f79a045fe00 (diff)
downloadchrono-cube-ui-e894e21956d8cfd0045125581f04291639d781ae.tar.gz
ci: add deploy rule :rocket:
Diffstat (limited to '.circleci')
-rw-r--r--.circleci/config.yml58
1 files changed, 51 insertions, 7 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index fef5ed0..84c6a35 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -1,11 +1,13 @@
version: 2
-jobs:
- build:
- docker:
- - image: circleci/node:12-stretch
- working_directory: ~/repo
+defaults: &defaults
+ working_directory: ~/repo
+ docker:
+ - image: circleci/node:12-stretch
+jobs:
+ checkout_and_test:
+ <<: *defaults
steps:
- checkout
- restore_cache:
@@ -15,7 +17,7 @@ jobs:
- v1-dependencies-
- run:
- name: install NPM dependencies
+ name: Install NPM dependencies
command: npm install
- save_cache:
@@ -24,6 +26,48 @@ jobs:
key: v1-dependencies-{{ checksum "package.json" }}
- run:
- name: Check types and lint code
+ name: Test syntax and perform type checking
command: npm test
+ deploy:
+ <<: *defaults
+ steps:
+ - checkout
+ - restore_cache:
+ keys:
+ - v1-dependencies-{{ checksum "package.json" }}
+ # fallback to using the latest cache if no exact match is found
+ - v1-dependencies-
+
+ - run:
+ name: Authenticate with registry
+ command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
+ - run:
+ name: Deploy package
+ command: npm run deploy
+
+
+workflows:
+ version: 2
+
+ test:
+ jobs:
+ - checkout_and_test
+
+ deploy:
+ jobs:
+ - checkout_and_test:
+ filters:
+ branches:
+ ignore: /.*/
+ tags:
+ only: /^v.*/
+ - deploy:
+ filters:
+ branches:
+ ignore: /.*/
+ tags:
+ only: /^v.*/
+ requires:
+ - checkout_and_test
+