Created
August 24, 2019 20:10
-
-
Save lior-amsalem/1ebd30a9b4fd035941a11aa4fbb7ea1a to your computer and use it in GitHub Desktop.
Basic workflows configuration
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
// … few jobs | |
workflows: | |
version: 2.1 | |
build-test-and-deploy: | |
jobs: | |
- build: # job #1 - here we build and prepare everything we need | |
context: dev | |
- test: # job #2 - is where we run our tests, linting, code coverage etc. | |
context: dev # for each job we can define “context” with environment variables (and define those in CircleCI dashboard as admin) | |
requires: | |
- build # Before we can continue, we need the “build” job to finish, our tests depend on dependencies from the build process. | |
- deploy_dev_branches: # job #3 - in some cases we want to deploy to dev/prod-like environment | |
context: dev | |
requires: | |
- test | |
filters: | |
branches: | |
ignore: # This is why we ignore master in this job. | |
- master | |
- deploy_production_latest: # job #4 - our last job is production “latest” | |
context: dev | |
requires: | |
- test # we can’t continue to production unless “test” job is finished successfully! | |
filters: | |
branches: | |
only: # We deploy latest only in master | |
- master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment