Created
May 9, 2017 12:06
-
-
Save christianklotz/175d0739c6f7517e564e0df7f44b687d to your computer and use it in GitHub Desktop.
Circle CI configuration with deployment stages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
general: | |
artifacts: | |
- "coverage/lcov-report" | |
machine: | |
node: | |
version: 7.6.0 | |
# environment: | |
# set the following variables in CircleCI project settings | |
# AWS_ACCESS_KEY_ID | |
# AWS_SECRET_ACCESS_KEY | |
# AWS_DEFAULT_REGION | |
# SLACK_URL | |
dependencies: | |
pre: | |
- sudo apt-get update && sudo apt-get install libpython2.7-dev | |
- sudo pip install awscli | |
post: | |
- npm run bootstrap | |
cache_directories: | |
- "packages/website/node_modules" | |
deployment: | |
# Commits to master deploy develop version | |
master: | |
branch: master | |
commands: | |
- cd packages/website; rm -r dist 2> /dev/null; npm run build; ./deploy.sh develop: | |
environment: | |
DEPLOYMENT_URL: https://develop.example.com # used to populate Slack message | |
NODE_ENV: production | |
S3_BUCKET: example.com-develop | |
# Staging and production deployments of the package are triggered by tagged commits. | |
website-staging: | |
tag: /^website\/v[0-9]+(\.[0-9]+)+-(beta|rc).[0-9]+$/ # limit tags with 'website/v1.2.3-beta.4' format | |
commands: | |
- cd packages/website; rm -r dist 2> /dev/null; npm run build; ./deploy.sh staging: | |
environment: | |
DEPLOYMENT_URL: https://staging.example.com | |
NODE_ENV: production | |
S3_BUCKET: example.com-staging | |
website: | |
tag: /^website\/v[0-9]+(\.[0-9]+)+$/ # limit tags to 'website/v1.2.3' format | |
commands: | |
- cd packages/website; rm -r dist 2> /dev/null; npm run build; ./deploy.sh production: | |
environment: | |
NODE_ENV: production | |
S3_BUCKET: example.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See https://philsturgeon.uk/2015/11/20/deploying-with-git-flow-tags-and-circleci for a more detailed description of the approach.