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
74 lines
1.9 KiB
version: 2.1
|
|
jobs:
|
|
Installation:
|
|
docker:
|
|
- image: circleci/node:14.10.1
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
|
|
- yarn-packages
|
|
- run: yarn global add node-gyp && yarn install && sudo yarn global add netlify-cli --unsafe-perm=true
|
|
- save_cache:
|
|
key: yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
|
|
paths:
|
|
- ./node_modules
|
|
Test:
|
|
docker:
|
|
- image: circleci/node:14.10.1
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
|
|
- run:
|
|
name: Start
|
|
command: yarn start
|
|
- run:
|
|
name: Format check
|
|
command: yarn format:check --write
|
|
- run:
|
|
name: Test
|
|
command: yarn test
|
|
- save_cache:
|
|
key: yarn-packages-{{checksum "yarn.lock"}}
|
|
paths:
|
|
- ./node_module
|
|
Build:
|
|
docker:
|
|
- image: circleci/node:14.10.1
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- yarn-packages-{{ checksum "yarn.lock" }}-{{ .Environment.CACHE_VERSION }}
|
|
- run:
|
|
name: Build Prod
|
|
command : yarn run build
|
|
Netlify:
|
|
docker:
|
|
- image: circleci/node:14.10.1
|
|
working_directory: ~/deploy-netlfify
|
|
steps:
|
|
- attach_workspace:
|
|
at: /tmp
|
|
- run:
|
|
name: Deploy
|
|
command: |
|
|
sudo npm install -g --silent netlify-cli
|
|
netlify deploy --prod --auth $NETLIFY_AUTH_TOKEN --dir=/tmp/dist --site $NETLIFY_SITE_ID
|
|
|
|
workflows:
|
|
Build_Test_Deploy:
|
|
jobs:
|
|
- Installation
|
|
- Test:
|
|
requires:
|
|
- Installation
|
|
- Build:
|
|
requires:
|
|
- Installation
|
|
- Netlify:
|
|
requires:
|
|
- Build
|