Skip to content

Instantly share code, notes, and snippets.

@lior-amsalem
Created August 24, 2019 20:11
Show Gist options
  • Save lior-amsalem/8aab0ba9a106c6f4a6ec6f43fa84e1af to your computer and use it in GitHub Desktop.
Save lior-amsalem/8aab0ba9a106c6f4a6ec6f43fa84e1af to your computer and use it in GitHub Desktop.
CircleCI with NPM token
// … 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