Skip to content

Instantly share code, notes, and snippets.

@germanescobar
Last active March 27, 2019 15:09
Show Gist options
  • Save germanescobar/b845dd7fb7b9ce2715b77f3712b0e508 to your computer and use it in GitHub Desktop.
Save germanescobar/b845dd7fb7b9ce2715b77f3712b0e508 to your computer and use it in GitHub Desktop.
A CircleCI configuration for Express, MongoDB, Puppeteer (testing) and Heroku (deployment)
version: 2
jobs:
build:
docker:
- image: circleci/node:9.2.0-browsers
- image: circleci/mongo:latest
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
deploy:
docker:
- image: buildpack-deps:trusty
steps:
- checkout
- run:
name: Deploy Master to Heroku
command: |
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/floating-savannah-66501.git master
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
filters:
branches:
only: master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment