Deploy to heroku on github push


we’re in the process of migrating our GitLab CI build to GitHub. Our applications are deployed on Heroku from GitLab. It works like this:

  1. a branch is merged to develop
  2. GitLab ci is triggered
  3. as part of the GitLab ci process a deploy step is run and it currently does this:
  image: myorganization/myproject
  stage: deploy
    - dpl --skip_cleanup --provider=heroku --app=aam-api-int --api-key=$HEROKU_STAGING_API_KEY
    - develop

dpl in this step uploads the already built application code to Heroku (that can be found in dist and dist-server respectively). Heroku at this point only runs npm start.

I thought I could do the same thing with Heroku’s GitHub integration, at least looking at this screen that was the promise:

Now part of this works, Heroku waits for the GitHub workflow to finish on branch develop, however the two artifacts that are built during the GitHub workflow:


are not present on Heroku neither I’ve come through the steps that explained at which point I should configure that.

I found some actions for deploying to Heroku from the GitHub Marketplace (see here), maybe you can try them in your case.
For example:
Deploy to Heroku
Deploy Docker Image to Heroku App

1 Like

Thank you. :raised_hands:

I looked at these actions, I think they do something else.

Both of them are pushing to a remote called heroku and probably that triggers the build on Heroku. I think this is similar to the integration I have on the screenshot above.

What I wanted to do is to upload the pre-built dist and dist-server folders from github-action to Heroku.

I have a temporary solution. Heroku runs npm build when a deploy is triggered so I simply put the command that creates dist and dist-server into npm build.

Now instead of uploading those two folders to Heroku, they are being created on Heroku.
This might be even better than re-using the files built on another machine.