regexper-static/.circleci/config.yml

60 lines
1.2 KiB
YAML
Raw Normal View History

2018-02-11 01:25:00 +00:00
version: 2
jobs:
2018-02-11 01:57:13 +00:00
build_deploy:
2018-02-11 01:25:00 +00:00
docker:
2018-02-11 02:01:58 +00:00
- image: circleci/node:latest
2018-02-11 01:25:00 +00:00
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" }}
2018-02-11 14:22:37 +00:00
- run:
name: Run tests
command: yarn test
- run:
name: Build site
command: yarn build
- run:
name: Deploy to S3
command: |
2018-02-11 15:08:23 +00:00
sudo apt-get -y -qq install awscli
2018-02-11 14:22:37 +00:00
aws s3 sync build s3://$DEPLOY_BUCKET/ --delete
workflows:
version: 2
2018-02-11 01:57:13 +00:00
preview:
jobs:
2018-02-11 01:57:52 +00:00
- build_deploy:
2018-02-11 01:57:13 +00:00
context: preview-context
filters:
tags:
ignore: /.*/
2018-02-11 01:57:13 +00:00
branches:
only: /.*/
prod:
jobs:
2018-02-11 01:57:52 +00:00
- build_deploy:
2018-02-11 01:57:13 +00:00
context: prod-context
filters:
tags:
only: /.*/
2018-02-11 01:57:13 +00:00
branches:
ignore: /.*/