I came across this great GitHub Action to deploy to Heroku by only doing a git push to your main branch. It’s really simple to configure, but I wanted to be able to trigger a deploy after a pull request gets merged as well.
This turned out to be quite simple. Per Action’s documentation, by adding this snippet into the yaml file that describes the action:

on:
  # Trigger the workflow on push or pull request,
  # but only for the master branch
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

I’m using the oldschool name for the mail branch 🤷‍♂️

Then, when a pull request is merged, the deploy gets triggered

GitHub action

And the code gets deployed to Heroku

Heroku Action

Enjoy!