How to keep a free Heroku Dyno up with Github Actions
Heroku, platform as a service (PaaS) that enables developers to build, run and operate applications entirely in the cloud. Has a generous free plan with 500 hundred hours of dyno uptime, increased to 1000 hours if we insert a payment method.
The downside of the free tier is that every free dyno will be shut down after 30 mins of inactivity, so if you need to keep up the dyno for some reason you have a problem.
Fortunately, GitHub's actions came to our rescue! With the Github Actions, we can create a cron scheduler of the action, doing a simple cURL to our Heroku Dyno Endpoint every 15 or 20 Minutes. By doing this, we can keep up our dyno, using the Heroku Free Plan.
Here, an example of how to use the action:
name: Trigger Heroku App Every Quarter on: schedule: - cron: '*/15 * * * *' jobs: build: name: Trigger App runs-on: ubuntu-latest steps: - name: cURL request run: curl https://your-app-url.herokuapp.com
Thank you for reading this article, I really appreciate it.