Fly.io
Deploy your Clojure application with Fly.io
Deploying to Fly.io from Local Machine
If you have created your application using the option :deploy :none
, you can deploy it to Fly.io by following these steps:
Add flyctl
System Dependency
Add flyctl
to the .mise.toml
file with the latest version available (or install it manually):
Then run mise install
.
Create a New Fly.io Configuration
Run the following commands to create a new Fly.io configuration:
This command will create a fly.toml
file in the root of your project. You can edit it to set the desired configuration.
SQLite
If you are using SQLite, you need to add a volume to the fly.toml
file:
PostgreSQL
For PostgreSQL, you have several options:
- Use Managed PostgreSQL from Fly.io.
- Run PostgreSQL as a regular service on Fly.io.
- Use any other managed PostgreSQL service, such as Neon or Supabase.
Deploying to Fly.io from GitHub Actions
Generate Access Token
Generate a new access token in your Fly.io account settings and add it to your repository secrets as FLY_API_TOKEN
.
Add the following .github/workflows/deploy.yml
file:
Deploy Your Application from GitHub Actions
Push your changes to the master
branch to trigger the deployment automatically.