CI/CD for Fly.io
Build and deploy a Docker image to Fly.io.
Use template →1env:
2 FLY_APP_NAME: "example-project"
3 PLATFORM: "linux/amd64"
4
5steps:
6 - label: ":docker: docker build and push"
7 key: "build"
8 plugins:
9 - dannymidnight/setup-flyctl
10 commands: |
11 fly auth docker
12 docker build -t registry.fly.io/${FLY_APP_NAME}:${BUILDKITE_COMMIT} --platform ${PLATFORM} .
13 docker push registry.fly.io/${FLY_APP_NAME}:${BUILDKITE_COMMIT}
14
15 - label: ":fly-io: fly deploy"
16 depends_on: "build"
17 plugins:
18 - dannymidnight/setup-flyctl
19 command: "flyctl deploy -i registry.fly.io/${FLY_APP_NAME}:${BUILDKITE_COMMIT}"
- Use cases
- Continuous deployment, Continuous integration
- Tools
- Docker
CI/CD for Fly.io
This template gives you a continuous deployment (CD) pipeline that builds and deploys a docker image to Fly.io.
At a glance:
How it works
This template:
- Builds and pushes a Docker image to the Fly.io registry.
- Deploys image to Fly.io.
Next steps
After you select Use template, you’ll:
- Connect the Git repository with your Fly.io application.
- Configure Buildkite with the following secrets:
FLY_ACCESS_TOKEN
,FLY_APP_NAME
. - Configure the compute—run locally, on-premises, or in the cloud.
- Run the pipeline.
You can then play around with the pipeline settings. For example, run the pipeline locally while you iterate on the definition or set a schedule to trigger a nightly build.
If you need help, please check our documentation, raise an issue , or reach out to support.