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.
 
 
 

74 lines
1.9 KiB

version: 2.1
jobs:
build:
docker:
- image: cimg/node:15.5.1-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: cimg/node:15.5.1-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: cimg/node:15.5.1-browsers
steps:
- checkout
- restore_cache:
keys:
- yarn-packages-{{ checksum "yarn.lock" }}--{{ .Environment.CACHE_VERSION }}
- run:
- name: Build the project
- command : yarn run build
- run:
- name: Copy build
- command: |
ls
cp build/ /tmp/build -r
- store_artifacts:
path: /tmp/build
- persist_to_workspace:
root: /tmp
paths:
- build
deploy:
docker:
- image: cimg/node:15.5.1-browsers
working_directory: ~/deploy-netlfify
steps:
- attach_workspace:
at: /tmp
- run:
name: Deploy app
command: |
sudo npm install -g --silent netlify-cli
ls /tmp
netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir=/tmp/build --site $NETLIFY_SITE_ID
workflows:
build_deploy:
jobs:
- build
- build-in-prod:
requires:
- build
- deploy:
context: netlify
requires:
- build
- build-in-prod