Yield generated for 3636ad5c-37b2-45c0-8e6d-29eabe5a43c2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

71 lines
1.8 KiB

version: 2.1
jobs:
build:
docker:
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- yarn-packages
- run: yarn global add node-gyp && yarn install
- save_cache:
key: yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
paths:
- node_modules
test:
docker:
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Start test
command: yarn test
build-in-prod:
docker:
- image: circleci/node:dubnium-browsers
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
- run:
name: Build
command : yarn run build
- run:
name: Copy build
command: |
cp dist/ /tmp/dist -r
- store_artifacts:
path: /tmp/dist
- persist_to_workspace:
root: /tmp
paths:
- dist
deploy:
docker:
- image: circleci/node:dubnium-browsers
working_directory: ~/deploy-netlfify
steps:
- attach_workspace:
at: /tmp
- run:
name: Deploy on netlify
command: |
sudo npm install -g --silent netlify-cli
netlify deploy --prod --auth $NETLIFY_TOKEN --dir=/tmp/dist --site $NETLIFY_SITE_ID
workflows:
build_deploy:
jobs:
- build
- build-in-prod:
requires:
- build
- deploy:
context: netlify
requires:
- build-in-prod