This is a barebones template to build an application with Nix and deploy it on Fly.io.
You can take a look at this barebones application serving this README.md on two environments:
- Staging: https://nix-fly-template-staging.fly.dev
- Production: https://nix-fly-template.fly.dev
- Use this template to create a repository for your app
- Launch a Fly app for each environment you want (prod, staging, etc.)
- Add your Fly apps' names in
fly.nix
, and configure.github/workflows/fly.yml
to deploy to your apps - Add a
FLY_API_TOKEN
secret to your GitHub repo containing a Fly API token - Modify
app.nix
andflake.nix
to build your app and Docker container however you want
GitHub Actions will deploy to staging then production on every push to the main branch.