This is a scale to zero Minecraft server in fly.io using GitHub Actions and without needing to use Terraform and have to manage state.
When the server is not used, it switches off, reducing costs. Note that you still need to reserve an IP in fly.io which will have a monthly cost.
You will need a fly.io account, then install and setup the fly.io CLI then run:
flyctl launch --name <minecraft server>
Where <minecraft server>
is the name of your minecraft server
MIT