Free Coffee Functions
It costs one cup of coffee a month for me to publish to Write.as every weekday until the end of time. That translates to “until the end of AWS,” because I use a Python function running in Lambda that is triggered on a regular schedule by EventBridge. A simple serverless architecture that helps me worry about servers “less” and more about what I want the code to do — hold me accountable to publishing something on my blog every week day.
A cup of coffee a month isn't much (depending on where you go), but I wonder why I have to pay for a cup of coffee at all. Why can't I have this event-based, serverless function run every week day for free somewhere else?
This is where I came across Github Actions. I've written about it before where I used it to create blog posts when a Github repo issue is created. Recently I discovered that you can run a workflow as a scheduled event. That means that you can have a workflow that triggers a Python script to run in your repo every week day. Like a Python script that publishes to your blog?
What excites me about this is that the Python code can be simplified even further. No Lambda function handler nonsense, just Python scripting. Even if I wanted to write functions, I could have Github Actions invoke the function like I would if I were testing it locally. Thanks containers!
Hoping to get something together to share later. it might be a kludge, something Github Actions isn't supposed to be used for, but then again that's what I enjoy most about technology — finding ways to put it to use that are on the fringes of personal preference.