# Integração com GitHub

## ✅ **Pré-requisitos**

{% stepper %}
{% step %}
**Consistência da Conta GitHub**

{% hint style="warning" %}
A conta GitHub usada para **login na Discloud** E **propriedade do repositório deve ser a mesma.**
{% endhint %}

> **Consequências de incompatibilidade**:
>
> * Repositórios não aparecerão
> * Falhas de uploads
> * Erros de permissão
>   {% endstep %}

{% step %}
**Arquivo** [**`discloud.config`**](/configurations/discloud.config.md) **Válido**

Deve existir no **diretório raiz** do seu repositório.

> ⚠️ **A validação falha se**:
>
> * Arquivo ausente
> * Sintaxe inválida
>   {% endstep %}
>   {% endstepper %}

***

## 🔄 **Conectar GitHub e Configurar Acesso**

{% stepper %}
{% step %}
Iniciar Conexão GitHub

* Vá para [Painel Discloud](https://discloud.com/dashboard) → aba **Integração GitHub**
* Clique em **Login** → Autorize Discloud via GitHub OAuth

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

{% endstep %}

{% step %}
Configurar Acesso ao Repositório

* Volte para **Integração GitHub** → Clique em **Configurar**
* Escolha o alvo da instalação.
* Defina permissões:
  * 🔓 *Todos os repositórios*
  * 🔒 *Selecionar repositórios específicos*
    {% endstep %}
    {% endstepper %}

***

## 🚀 **Upload do GitHub**

{% stepper %}
{% step %}
**Iniciar Upload**

* Vá para [Painel Discloud](https://discloud.com/dashboard)
* Clique em "**+ Upload"** (canto superior direito)
* Selecione "**GitHub"** no menu
  {% endstep %}

{% step %}
**Configuração e Upload**

{% hint style="info" %}

#### **🔐 Variáveis de Ambiente Seguras**

Use arquivos [`.env`](/faq/general-questions/.env-file.md) localmente para desenvolvimento, mas certifique-se de que eles sejam adicionados ao `.gitignore` para evitar exposição acidental no GitHub. Ao fazer o upload via integração GitHub da Discloud, **adicione segredos de produção diretamente na seção "Variáveis de Ambiente"** durante a configuração.
{% endhint %}
{% endstep %}
{% endstepper %}

<figure><img src="/files/NZzjCwePOWvmQOwXm2mV" 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/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.
