Yield generated for c5930fa1-99d2-4a57-8ebb-edc1beb2919e
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.
 
 
 

83 lines
2.4 KiB

version: 2
jobs:
build:
docker:
- image: circleci/node:dubnium-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run: yarn global add node-gyp && yarn install
- run: yarn global add serve
- run: yarn run build
- run: yarn run test
# - run: yarn run serve
- save_cache:
paths:
- node_modules
key: dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }}
artifact-save:
docker:
- image: circleci/node:dubnium-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- run: yarn build
- run:
name: Copy deployment artifacts to workspace
command: |
cp ./dist /tmp/server -r
- store_artifacts:
path: /tmp/server
- persist_to_workspace:
root: /tmp
paths:
- server
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
netlifly-deploy:
docker:
- image: circleci/node:dubnium-browsers
working_directory: ~/repo
steps:
- checkout
- restore_cache:
keys:
- dependencies-{{ checksum "package.json" }}-{{ .Environment.CACHE_VERSION }}
# fallback to using the latest cache if no exact match is found
- dependencies-
- attach_workspace:
at: /tmp
- run:
name: Deploy app
command: sudo npm netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFLY_DEVOPSFINAL_TOKEN --prod -dir=/tmp/server
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
workflows:
version: 2
build-deploy:
jobs:
- build
- artifact-save:
requires:
- build
- netlifly-deploy:
requires:
- build
- artifact-save