Fly.ioTutorial
Continuous Deployment with GitLab
Summary
The guide shows how to set up continuous deployment from GitLab CI/CD to a Fly application, using the small Go hellofly example. GitLab supplies the repository contents to a Runner defined by the golang:1.13 image, while a before_script installs curl and downloads flyctl through Fly’s installation script. A deploy job then runs flyctl deploy, which builds and deploys the application from a committed fly.toml file. Authentication is configured by obtaining a token with flyctl auth token and storing it as a protected, masked FLY_API_TOKEN CI/CD variable in the repository settings. After .gitlab-ci.yml is committed and pushed, GitLab starts the deployment job, while the guide notes that more advanced pipeline structures and triggers remain available.
Context
The guide was created after a request for a GitLab equivalent to an existing guide for continuous deployment with Fly and GitHub Actions. It also presents the setup as an example applicable to other CI/CD platforms.
Approach / What changed
Define a GitLab CI/CD configuration using the golang:1.13 Runner image, install flyctl in before_script, run flyctl deploy in a deploy job, commit a fly.toml file to the repository, and provide authentication through a protected, masked FLY_API_TOKEN variable.
Takeaways
GitLab automatically copies repository contents into the configured Runner, satisfying the application-source requirement for the deployment process.
The configuration installs curl and uses Fly’s installation script to obtain a runnable flyctl before the deployment job runs.
The API token is stored in GitLab’s CI/CD variables as FLY_API_TOKEN with Protected and Masked enabled to prevent exposure in logs.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.