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.
97 lines
1.9 KiB
97 lines
1.9 KiB
executors:
|
|
node:
|
|
docker:
|
|
- image: circleci/node:10.18.0
|
|
|
|
|
|
aliases:
|
|
restore_cache: &restore_cache
|
|
restore_cache:
|
|
keys:
|
|
- yarn-cache-netlify-{{ checksum "yarn.lock" }}
|
|
|
|
install_node_modules: &install_node_modules
|
|
run:
|
|
command: yarn install
|
|
|
|
save_cache: &save_cache
|
|
save_cache:
|
|
key: yarn-cache-netlify-{{ checksum "yarn.lock" }}
|
|
paths:
|
|
- ./node_modules
|
|
|
|
|
|
version: 2.1
|
|
orbs:
|
|
node: circleci/node@3.0.0
|
|
jobs:
|
|
test:
|
|
executor: node
|
|
steps:
|
|
- checkout
|
|
- <<: *restore_cache
|
|
- <<: *install_node_modules
|
|
- <<: *save_cache
|
|
- run:
|
|
name: Test
|
|
command: yarn run test
|
|
check_format:
|
|
executor: node
|
|
steps:
|
|
- checkout
|
|
- <<: *restore_cache
|
|
- <<: *install_node_modules
|
|
- <<: *save_cache
|
|
- run:
|
|
name: Test
|
|
command: yarn add --dev --exact prettier && yarn format:write && yarn format:check
|
|
build:
|
|
executor: node
|
|
steps:
|
|
- checkout
|
|
- <<: *restore_cache
|
|
- <<: *install_node_modules
|
|
- run:
|
|
name: Build
|
|
command: yarn run build
|
|
- persist_to_workspace:
|
|
root: ./
|
|
paths:
|
|
- public
|
|
deploy:
|
|
executor: node
|
|
steps:
|
|
- checkout
|
|
- attach_workspace:
|
|
at: ./
|
|
- <<: *restore_cache
|
|
- <<: *install_node_modules
|
|
- run:
|
|
name: Install netlify-cli
|
|
command: yarn global add netlify-cli
|
|
- run:
|
|
name: Deploy to Netlify
|
|
command: yarn run build && yarn run netlify:deploy
|
|
|
|
|
|
|
|
workflows:
|
|
test_build_and_deploy:
|
|
jobs:
|
|
- test:
|
|
filters:
|
|
branches:
|
|
ignore:
|
|
- gh-pages
|
|
- check_format :
|
|
requires:
|
|
- test
|
|
- build:
|
|
requires:
|
|
- check_format
|
|
- deploy:
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: main
|