Skip to content

Instantly share code, notes, and snippets.

@srt32
Created June 15, 2017 16:35
Show Gist options
  • Save srt32/d32a8078694eac906d2f392a68257f70 to your computer and use it in GitHub Desktop.
Save srt32/d32a8078694eac906d2f392a68257f70 to your computer and use it in GitHub Desktop.
Building and Deploying Docker Images to Heroku via CircleCI
machine:
services:
- docker
dependencies:
override:
- echo "no deps"
test:
post:
- echo "yay - no tests"
deployment:
production:
branch: master
commands:
- docker build -t backer-board .
- docker login --email=_ --username=_ --password=$HEROKU_TOKEN registry.heroku.com
- docker tag backer-board:latest registry.heroku.com/backer-board/web
- docker push registry.heroku.com/backer-board/web
@vforv
Copy link

vforv commented Apr 7, 2018

This will add image to registry but how to deploy that image to heroku host?

@m-alikhizar
Copy link

Yes. same question. I've the following in config.yml

- run:
          name: Deploy to Heroku
          command: |
             docker login --username=$HEROKU_LOGIN --password=$HEROKU_API_KEY registry.heroku.com
             docker tag khizarali/dockerized-store:$CIRCLE_SHA1 registry.heroku.com/$HEROKU_APP_NAME/web
             docker push registry.heroku.com/$HEROKU_APP_NAME/web

Here image is pushed to registry.heroku.com and what next to get it up and running on heroku app. something heroku container:release ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment