# GitHub Integration

## ✅ **Prerequisites**

{% stepper %}
{% step %}
**GitHub Account Consistency**

{% hint style="warning" %}
The GitHub account used for **Discloud login** AND **Repository ownership, must be the same.**
{% endhint %}

> **Consequences of mismatch**:
>
> * Repositories won't appear
> * Deployment failures
> * Permission errors
>   {% endstep %}

{% step %}
**Valid** [**`discloud.config`**](/en/configurations/discloud.config.md) **File**

Must exist in your repository's **root directory.**

> ⚠️ **Validation fails if**:
>
> * File missing
> * Invalid syntax
>   {% endstep %}
>   {% endstepper %}

***

## 🔄 **Connect GitHub & Configure Access**

{% stepper %}
{% step %}
**Initiate GitHub Connection**

* Go to [Discloud Dashboard](https://discloud.com/dashboard) → **GitHub Integration** tab
* Click **Login** → Authorize Discloud via GitHub OAuth

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

{% endstep %}

{% step %}
**Configure Repository Access**

* Return to **GitHub Integration** → Click **Configure**
* Choose installation target.
* Set permissions:
  * 🔓 *All repositories*
  * 🔒 *Select specific repositories*
    {% endstep %}
    {% endstepper %}

***

## 🚀 **Deploy from GitHub**

{% stepper %}
{% step %}
**Start Deployment**

* Go to [Discloud Dashboard](https://discloud.com/dashboard)
* Click "**+ Upload"** (top-right corner)
* Select "**GitHub"** from the menu
  {% endstep %}

{% step %}

#### **Configuration & Upload**

{% hint style="info" %}

#### 🔐 Secure Environment Variables

Use [`.env`](/en/faq/general-questions/.env-file.md) files locally for development, but ensure they're added to `.gitignore` to prevent accidental exposure on GitHub. When deploying via Discloud's GitHub integration, **add production secrets directly in the "Environment Variables" section** during configuration.
{% endhint %}
{% endstep %}
{% endstepper %}

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


---

# Agent Instructions: 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.
