You could use GitHub actions to do the build and send it off to some CDN to deploy, or if you were self-hosting the whole thing, you could have a Flask app listen for a webhook and re-build your site when that's received. Or simply pull in from the git origin and rebuild with a cron job.
I guess what I'm getting at is doing that would be a big patchwork of putting all that together. Not a unified system. I'd gladly make a one time payment for a unified piece of software that does everything (or of course gladly adopt something open source).
Also, to your specific example, does there exist a Flask app that runs on AWS lambda that can listen for a webhook and then build a static website?
Does there exist code that I can put into Github actions that builds a static website and uploads it to a CDN?
That's basically what I'm looking for.
Of course I could write my own solution or cobble it together with a bunch of moving parts, but my whole point is that I'm looking for an existing package that already does it.
If you use a tool like the Serverless Framework, you can "cobble together the moving parts" and store it into GitHub and make it easily deployable into the cloud. Putting together pieces is what software development is. If you are used to OOP this is even more relevant as the entire idea of OOP is to create discrete pieces of code and compile them together.
PHP for example used to be a "big patchwork" of seperate files working together, but the right tooling came along to think of it as "a unified system". Same thing with Serverless and the Serverless Framework
Shouldn't be too difficult to hook this up to a build command for hugo, jekyll, or whichever static site generator you'd prefer. But this gets away from the self-hosted part of what you were saying a bit.