Deploy on Heroku with gitlab CI-CD

Hello guys. I need help.
I’m trying to deploy my app using the Gitlab docker image.

I don’t know how to deploy a Phoenix app on Heroku using the .gitlab-ci.yml. I didn’t find any information about that. Does anyone have an example of this file to base me on?

thanks!

I do not have such a gitlab-ci file, as I do not think the file alone will be enough.

Therefore let me ask some things…

  1. Are you at least somewhat experienced with gitlab CI in general?
  2. Are you at least somewhat experienced with deploying to heroku from your local machine?

If you could answer both with yes, then just set up a stege for deployment that runs an image that can run the heroku command and sets itself up during run to have proper keys available and unlocked, then just run heroku deploy or what the command was in that container.

yes, I worked some things with javascript and that was very easy to implement with Heroku and Gitlab. I deployed the project doing that: https://elixircasts.io/deploying-elixir-with-heroku

All were manual, but now I like to automate it.

I found two ways to do that:

Heroku is not gigalixir and things might be different.

As I said already, once you understand how to deploy without CI/CD it should be trivial to implement in any CI/CD pipeline.

But to do this, you need to understand manual steps first, you’ll gain nothing from a premade CI file that doesn’t suite your needs or is underdocumented and you miss important variables in the pipeline.

Personally I use gitlab ci a lot, for work and personally. At the office I’m called “the deployveloper” because I always find some way to deploy from gitlab. And this is easiest when starting from a fresh VM and recreating and reinstalling the necessary toolchain from scratch and understanding what’s going on.

1 Like

Many thanks, @NobbZ, I tried to do that and It works! :+1: