In my team, we use Gitlab as a remote repository, so we are looking for a solution to auto deploy our apps to Heroku. We found Codeship for auto deploying apps to Heroku from Github.
Any tips? Tricks?
To deploy your app to Heroku, use the git push command to push the code from your local repository's main branch to your heroku remote. For example: $ git push heroku main Initializing repository, done.
You can use https://github.com/ddollar/heroku-push and push directories without git.
Enabling GitHub Integration You can configure GitHub integration in the Deploy tab of apps in the Heroku Dashboard. To configure GitHub integration, you have to authenticate with GitHub. You only have to do this once per Heroku account. GitHub repo admin access is required for you to configure automatic GitHub deploys.
If you are not prepared to use Ruby/dpl you can deploy to Heroku as follows:
Look up your Heroku API key (Account settings -> API Key on the Heroku web console) and make it available as a Gitlab secret variable e.g. HEROKU_API_KEY (Please note the values is not the same as what heroku auth:token returns...)
Then add two script lines in your .gitlab-ci.yml
config file at the relevant job:
git remote add heroku https://heroku:[email protected]/<name of your heroku app>.git git push -f heroku HEAD:master
You can see detailed explanation at http://blog.thecodewhisperer.com/permalink/deploying-jekyll-to-heroku-using-gitlab-ci
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With