Home · RSS · E-Mail · GitHub · GitLab · Twitter · Mastodon

Deploy Go code to Heroku with GitLab CI

first published:

» Introduction

Updated on 2019-03-09: Using go mod instead of dep.

I’ve created a very minimalistc repository to show, how to deploy Go code to Heroku using GitLab CI.

Automatically triggered on push/merge:

» How-To

  1. Create a new Heroku Pipeline.

    New Pipeline

  2. Set up as many Heroku apps in this pipeline as you need (e.g. staging and production).


  3. git clone this repository or copy whatever you need.

  4. Get your Heroku API key found in your account.

    API Key

  5. Set the key as the variable HEROKU_API_KEY in your GitLab CI / CD Settings.

    CI/CD Variables

  6. Modify .gitlab-ci.yml and change the existing app name (-app=gitlab-heroku-deploy-*) to your newly created apps.

» Hints

» Older approach using godep

See the using-godep branch for an example using dep instead of go modules.

» Further Reading

Home · RSS · E-Mail · GitHub · GitLab · Twitter · Mastodon