# Deploy your code

> Put an application online from a GitHub or GitLab repository, built on every push by Fransys continuous integration.

Source: https://docs.fransys.cloud/en/demarrer/deployer-votre-code/ Checked against the console on 2026-10-23.

## How it works

Fransys builds your application's Docker image on every push, then deploys it. To do this, it opens a merge request on your repository that adds its pipeline. Your code isn't changed.

You need a project attached to a cluster. If you don't have one yet, start with the [First deployment](https://docs.fransys.cloud/en/demarrer/premier-deploiement/).

## The steps

1. **Add the service**

   In the project, click **Add a service**, then **Application**. Fransys prepares its settings in one to two minutes.

2. **Choose the code origin**

   In the service panel, set the code origin to GitHub or GitLab. Click **Link GitHub** (or GitLab) if your account isn't linked yet, then pick the repository and the branch.

3. **Connect continuous integration**

   Click **Connect CI**, then **Create the merge request**. On your repository:
   - follow the instructions in the merge request;
   - merge it;
   - wait for the pipeline to finish: your latest commit then shows up in the service.

   Fransys adds its own CI files without touching what's already there, plus a few variables prefixed with `FRANSYS_` in the repository.

4. **Tell Fransys how to start the application**

   The **Tell Fransys how to start your application** guide asks for three things:
   - **The port** your application listens on;
   - **Its variables**: application key, database access, email…;
   - **Its neighbours**: database, cache, queues.

   The easiest way is to ask your agent (see below). Otherwise, do it by hand: set the container port, import your `.env.example` into the [variables](https://docs.fransys.cloud/en/projets/variables-et-secrets/), and [add the linked databases](https://docs.fransys.cloud/en/projets/bases-de-donnees/).

5. **Deploy**

   Click **Deploy**. See [Deploy and monitor](https://docs.fransys.cloud/en/projets/deployer-et-suivre/).

## Let your agent prepare it

Open your agent in the repository folder and give it the instruction the guide suggests (the **Copy the instruction** button). The agent reads the Dockerfile, the docker-compose file and the `.env.example`, then prepares a plan: port, variables, databases to add and link. Nothing changes without your go-ahead: you review the plan in the console before running it. See [Plans](https://docs.fransys.cloud/en/agents/plans/).

For other processes (queues, websockets), the agent copies the service and picks its role with an environment variable: Fransys doesn't let you change the container command. For scheduled jobs, it uses a recurring command.

## Build-time variables

Variables read at build time (for example `VITE_…`) aren't passed on by Fransys CI yet. Keep them in your code, or read them when the application starts.

## Your commit doesn't show up

See [Latest commit not imported](https://docs.fransys.cloud/en/projets/github-gitlab/#latest-commit-not-imported).
