all-contributors-cli/.circleci/config.yml

70 lines
1.4 KiB
YAML
Raw Normal View History

version: 2.1
docker_defaults: &docker_defaults
docker:
- image: circleci/node:8.14.0
commands:
prep_env:
description: Prepares environment with cache
steps:
- checkout:
path: ~/repo
- restore_cache:
name: Restore node_modules cache
key: all-contributors-cli-{{ checksum "package.json" }}-{{ .Branch }}
save_env_cache:
description: Saves environment cache
steps:
- save_cache:
name: Save node_modules cache
key: all-contributors-cli-{{ checksum "package.json" }}-{{ .Branch }}
paths:
- node_modules/
jobs:
node_modules:
<<: *docker_defaults
working_directory: ~/repo
steps:
- prep_env
- run: yarn install
- save_env_cache
validate:
<<: *docker_defaults
working_directory: ~/repo
steps:
- prep_env
- run: yarn validate
- persist_to_workspace:
root: ./
paths:
- dist
- coverage
deploy:
<<: *docker_defaults
working_directory: ~/repo
steps:
- prep_env
- attach_workspace:
at: ./
- run: yarn kcd-scripts travis-after-success
workflows:
version: 2
test_and_deploy:
jobs:
- node_modules
- deploy:
requires:
- node_modules
filters:
branches:
only:
- master
experimental:
notify:
branches:
only:
- master