This is mostly a reference for myself (hi, future me) but hopefully useful for anyone who's already deployed an ASP.NET Core MVC app on Fly.io and just needs to push updates. The Fly.io docs are good, but I always want the shortest possible version.
Here's the workflow.
Install the CLI
If you don't have flyctl yet:
curl -L https://fly.io/install.sh | shAuthenticate
flyctl auth loginDeploy
Make sure you're in the project directory where fly.toml lives, then:
flyctl deployThat's usually it. Fly.io handles the containerization and the rest.
Apply database migrations (if needed)
If the schema changed, SSH in and run migrations before the new code starts serving requests:
flyctl ssh console -a <your-app-name>
dotnet ef database update
exitRestart the app (if needed)
flyctl apps restart <your-app-name>I've had to do this a couple times when the deploy succeeded but the app didn't pick up the changes right away. A little annoying, but fixable.
Fly.io is pretty nice for this kind of setup, honestly. The first deployment takes some doing, but redeployments are fast once everything's configured.