Skip to content

Instantly share code, notes, and snippets.

@Manikkumar1988
Last active October 8, 2019 17:23
Show Gist options
  • Save Manikkumar1988/d897e61804ae687b55c58d37144dbafe to your computer and use it in GitHub Desktop.
Save Manikkumar1988/d897e61804ae687b55c58d37144dbafe to your computer and use it in GitHub Desktop.
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: markhobson/node-chrome
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/mongo:3.4.4
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: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
# run tests!
- run: npm run test-headless
- setup_remote_docker: # (2)
docker_layer_caching: true # (3)
# use a primary image that already has Docker (recommended)
# or install it during a build like we do here
- run:
name: Install Docker client
command: |
set -x
VER="17.03.0-ce"
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
mv /tmp/docker/* /usr/bin
- run:
name: Login to heroku ecr
command: docker login -username=$HEROKU_USERNAME --password=$HEROKU_API_KEY registry.heroku.com
- run:
name: Setup Heroku
command: chmod +x .circleci/setup-heroku.sh
- run:
name: setting up heroku container
command: .circleci/setup-heroku.sh
- run:
name: building and pushing image
command: heroku container:push web --app $HEROKU_APP_NAME
- run:
name: Deploy to Heroku
command: heroku container:release web --app $HEROKU_APP_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment