Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
64 lines (39 sloc) 1.79 KB

How to deploy on Heroku

Follow these steps to deploy apps to Heroku.

Automatically with CI

  • Create a Heroku app and take note of its name.

  • Set the following variables for the CI system to deploy on staging:

    • Set the following variables for the CI system to deploy on production:
  • After CI deployment succeeded, use heroku client on your project, $ heroku git:remote -a <heroku-app-name> and then:

    $ heroku config # to see the list of config vars
    $ heroku ps:scale web=1 # to start the web
  • Configure the Heroku app environment variables if any

  • After that, open the Heroku app, it should work

Or Manually with Heroku Docker

Make sure to have Docker running on your machine.

https://devcenter.heroku.com/articles/container-registry-and-runtime

  • Login to Heroku registry:
$ heroku container:login
  • Deploy with existing Docker image
$ docker pull <image>
$ docker tag <image> registry.heroku.com/<heroku_app_name>/web
$ docker push registry.heroku.com/<heroku_app_name>/web

For example, to deploy registry.gitlab.com/hoatle/nextjs-hello-world:develop to acme-nextjs-hoatle Heroku app:

$ docker pull registry.gitlab.com/hoatle/nextjs-hello-world:develop
$ docker tag registry.gitlab.com/hoatle/nextjs-hello-world:develop registry.heroku.com/acme-nextjs-hoatle/web
$ docker push registry.heroku.com/acme-nextjs-hoatle/web

References