regexper-static/.circleci/config.yml
2018-05-29 17:30:51 -04:00

67 lines
1.3 KiB
YAML

version: 2
jobs:
build_deploy:
docker:
- image: circleci/node:latest
working_directory: ~/repo
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run:
name: Run tests
command: yarn test
- store_artifacts:
path: reports
- store_test_results:
path: reports/junit.xml
- run:
name: Build site
command: yarn build
- store_artifacts:
path: build
- run:
name: Deploy to S3
command: yarn deploy
workflows:
version: 2
preview:
jobs:
- build_deploy:
context: regexper-preview
filters:
tags:
ignore: /.*/
branches:
only: /.*/
prod:
jobs:
- build_deploy:
context: regexper-prod
filters:
tags:
only: /.*/
branches:
ignore: /.*/