Automate preview deployments similar to Vercel?

I’m getting started with and Phoenix and am curious if anyone has managed to set up their deployments in a Vercel-like fashion?

I.e. Any pushes to main are production deployments, and any other branches are preview deployments

There isn’t a pre-built script to do this right now, but it is possible to set this up using Github Actions integration: Continuous Deployment with Fly and GitHub Actions

There’s a little more nuance with backend applications and preview deploys, like do you want the same secrets set on your preview deploys as well, or some kind of preview secrets template; which database you might want to connect the previews etc. Do you have any thoughts on details like that?

Ideally there’d be a separate database and set of secrets for the preview environment(s).

On Vercel you specify what environment the secrets apply to (DEV, PREVIEW, PRODUCTION).

Is the most trivial approach to have a separate project that is constantly overridden by the latest branch deployment? Then set up another GitHub workflow to watch for branches (excl. main)?