---
title: "Continuous Deployment with GitLab"
description: "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."
---

# Continuous Deployment with GitLab

[Fly.io](https://yomu.fyi/company/fly-io) · Mar 23, 2020

**Type:** Tutorial

## 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.

**Tags:** [Fly](https://yomu.fyi/topic/fly), [GitLab](https://yomu.fyi/topic/gitlab), [Go](https://yomu.fyi/topic/go)

- Source: [Fly.io](https://fly.io/blog/continuous-deployment-with-gitlab)
- Source URL: https://fly.io/blog/continuous-deployment-with-gitlab
- Ingested by Yomu: 2026-09-02T12:00:04.973Z

[Read original post](https://fly.io/blog/continuous-deployment-with-gitlab)
