> For the complete documentation index, see [llms.txt](https://docs.discloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.discloud.com/en/api-and-integrations/github-integration.md).

# GitHub Integration

### 🧭 Overview

The **GitHub Integration** allows you to deploy applications directly from a GitHub repository to Discloud, no manual ZIP uploads required. Discloud pulls the code from your repository, reads the [`discloud.config`](https://github.com/discloud/docs/blob/english/configurations/discloud.config) at the root, and builds and starts your application automatically.

This is the recommended workflow for teams and anyone using version control as part of their development process.

***

### ✅ Prerequisites

Before connecting GitHub, make sure the following are in place:

{% hint style="warning" %}
**Same GitHub account** - The GitHub account you use to **log in to Discloud** must be the **same account that owns the repository**. If you log in with a different GitHub account, your repositories will not appear in the integration.
{% endhint %}

{% hint style="success" %}
[**`discloud.config`**](https://github.com/discloud/docs/blob/english/configurations/discloud.config) **at the root** - This file must exist at the root of your repository. Without it, the upload will fail validation. Learn more about the root of the project.
{% endhint %}

{% hint style="danger" %}
**Never commit** [**`.env`**](/en/faq/general-questions/.env-file.md) **files** - Your `.env` file must be listed in `.gitignore`. Production secrets are set directly in Discloud during the upload step, not through the repository.
{% endhint %}

***

### 🔗 Connect your GitHub account

{% stepper %}
{% step %}
**🔑 Open the GitHub Integration tab**

Go to the [Discloud Dashboard](https://discloud.com/dashboard) and open the **GitHub Integration** tab.

Click **Login** and authorize Discloud via GitHub OAuth. This allows Discloud to read your repositories.

<figure><img src="/files/dFddzh4QDa2S9ewi9xQO" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**⚙️ Configure repository access**

After authorizing, click **Configure** on the GitHub Integration page. GitHub will ask you to choose which repositories Discloud can access:

* 🔓 **All repositories** - Discloud can access every repository in your account
* 🔒 **Selected repositories** - Choose only the specific repositories you want to deploy

{% hint style="info" %}
You can change this at any time by returning to the **GitHub Integration** tab and clicking **Configure** again, or by managing the Discloud GitHub App directly from your GitHub account settings.
{% endhint %}
{% endstep %}
{% endstepper %}

***

### 🚀 Deploy from GitHub

{% stepper %}
{% step %}
**🚀 Start a new upload**

Go to the [Discloud Dashboard](https://discloud.com/dashboard), click **+ Upload** in the top-right corner, and select **GitHub** from the menu.

<figure><img src="/files/Don8aC1xNYLigwjXxiAA" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
**🛠️ Configure your deployment**

**Repository & branch** - Choose the repository and the branch you want to deploy from. Discloud will pull the latest commit from that branch.

**Environment variables** - Add your production secrets here as `KEY=VALUE` pairs, one per line.

<figure><img src="/files/TrN4svaEft6s9FuO8pcK" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
**This is the only place to set production secrets.** `.env` files must not be committed to GitHub. Discloud stores these values securely and generates a `.env` file at the root of your application at runtime, keeping them out of your repository entirely.
{% endhint %}

{% hint style="warning" %}
If you forget to add a variable here, your application will start without it and may crash or behave incorrectly. To update environment variables later, you can edit them directly in the dashboard if you have a [paid plan](https://discloud.com/plans). Otherwise, you will need to do a new commit manually upload with the complete updated `.env` content.
{% endhint %}
{% endstep %}

{% step %}
**✅ Confirm and deploy**

Review your settings and click **Upload**. Discloud will:

1. Pull the code from your selected repository and branch
2. Validate your `discloud.config`
3. Install dependencies and run the build command (if configured)
4. Start your application

<figure><img src="/files/ybViZxFXK5cWEc2gcrxO" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***

### 🔁 Updating your application

Discloud automatically redeploys your application whenever you push new commits to the branch configured during the initial upload. No manual action is required.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.discloud.com/en/api-and-integrations/github-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
