HerokuAndrew FawcettTutorial
Using GitHub Actions with Heroku Flow for additional Security Control
Summary
The pattern combines GitHub Actions with Heroku Flow for private repositories and stricter security requirements when GitHub organization IP restrictions cannot use Heroku IP ranges. A custom self-hosted GitHub Runner runs as a Docker image on Heroku, while the Platform API and Source Endpoint API upload source code to ephemeral storage, build and deploy apps, and manage Review Apps. Event-specific workflows handle pushes, manual runs, schedules, and pull requests; a weekly workflow rebuilds and autodeploys the runner image within GitHub’s 30-day update window. Setup uses a Heroku Private Space, its outbound IPs, a GitHub access token, and organization name, but omits the repository URL in the Review App UI, does not run conventional Heroku CI tests, and is incompatible with Fir.
Context
GitHub organizations cannot be configured with Heroku IP ranges, creating a problem for organizations with security rules requiring IP restrictions. The pattern also addresses private repositories, regulated environments, and the need to manage GitHub Runner updates while retaining Heroku Pipeline visibility.
Approach / What changed
The setup runs a custom GitHub self-hosted Runner as a Docker image on Heroku and uses Heroku’s Platform API and Source Endpoint API to upload source code, deploy applications, and create, update, or remove Review Apps. A weekly workflow rebuilds and autodeploys the runner image, while GitHub Actions workflows respond to deployment and pull request events. The documented configuration uses a Heroku Private Space, outbound IPs, a GitHub access token, and organization name.
Takeaways
A Heroku-hosted custom runner can automate GitHub Actions workflows for Heroku deployments and Review Apps while keeping source code briefly on ephemeral storage.
The Heroku Flow Action maps specific events to operations: deployments for pushes, manual runs, and schedules; Review App creation or updates for pull requests; and removal when a pull request closes.
This sample does not use Heroku’s standard Git repository, so conventional Heroku CI tests are not run; it also uses a custom GitHub image and is incompatible with Fir.
Source and freshness
- Source
- heroku.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.