EPTSS - Automating project maintenance tasks with Github Actions
From database updates to automating email
Everyone Plays the Same Song has quite a few manual touchpoints that I've been wanting to automate for some time. Since it's a Next.js site deployed on Netlify, I don't have a long running server on which I can set up cron jobs for things. But what I realized I could do - and did - is set up cron triggered Github Actions to make requests to the EPTSS website's API layer at regular intervals.
I've set up three actions -
- One to assign the winning song to the round as soon as voting is over
- One to create future rounds when a round closes, so there is always 2 future rounds ahead of the current one
- One to send round participants reminders that voting and covering rounds are almost over
I've created a secret key in both the website's environment and in the Github Actions scope so that my actions can make their regular requests, which the endpoints will only respect with the proper key. Most requests result in no action, as it's not time in the project for said actions to occur, but this additional request traffic to the site is negligible, and this still keeps me way under the Github Actions request limit for their free tier (2000 minutes/mo at the time of writing).
The Actions themselves are defined in YAML. Here is an example.