> ## Documentation Index
> Fetch the complete documentation index at: https://guide.cloudsania.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Integrate GitHub

> Step-by-step guide to integrate GitHub with Cloudsania for automated deployments

## Overview

This guide will walk you through the process of integrating GitHub with Cloudsania to enable automated deployments and repository management.

## Prerequisites

Before you begin, ensure you have:

* A Cloudsania account
* Admin access to your GitHub repositories
* GitHub organization or personal account

## Step-by-Step Guide

### Video Tutorial: Setting Up GitHub Integration

<iframe src="https://player.vimeo.com/video/1078588879?h=02a610ac03" width="100%" height="400" frameBorder="0" allow="autoplay; fullscreen; picture-in-picture" allowFullScreen />

### Step 1: Enable GitHub Integration in Cloudsania

1. Log in to Cloudsania and navigate to Integrations from the sidebar
2. Locate GitHub in the list of available integrations
3. Toggle the GitHub switch to activate the integration
4. Click Confirm in the confirmation pop-up

![Enable Integration](https://api.monosnap.com/file/download?id=SqNxaeSMmAKgyg86tTKGaehC1209Np)
![Confirm Integration](https://api.monosnap.com/file/download?id=fZlW7FmPGpt99OSpT2ruzx7qTdlAGP)

### Step 2: Authorize Cloudsania on GitHub

1. You'll be redirected to GitHub's authorization page
2. Select the account or organization where Cloudsania should be installed

![GitHub Authorization](https://api.monosnap.com/file/download?id=VZXwc786I0i0wOO8TnWwwJmw5begnd)

### Step 3: Grant Repository Access & Permissions

1. Choose repository access level:
   * All repositories (Grants access to all existing and future repositories)
   * Only select repositories (Choose specific repositories for Cloudsania to manage)

2. Review required permissions:
   * Read access to code, commit statuses, merge queues, and metadata
   * Read & Write access to repository webhooks

3. Click Install & Authorize to confirm integration

![Repository Access](https://api.monosnap.com/file/download?id=x3fsYcJeIV19Klzk6mgTf6zYlj4aEt)
![Permissions](https://api.monosnap.com/file/download?id=1A4GVit9bpER0P6O9cpStZ8YwOTiq1)

### Step 4: Verify GitHub Integration

1. You'll be redirected back to Cloudsania
2. A confirmation message will appear indicating successful integration
3. The GitHub toggle in the Integrations tab will now be active

![Verification](https://api.monosnap.com/file/download?id=FFBYUEArwaWDLrzO0wKsYiTAz0nqob)

## Managing Your Integration

### Repository Management

* View connected repositories
* Manage repository access
* Configure branch settings

### Automated Deployments

* Set up deployment triggers
* Configure CI/CD pipelines
* Monitor deployment status

## Security Best Practices

### Access Management

* Regular permission audits
* Branch protection rules
* Access token management

### Security Configuration

* Secure webhook configuration
* IP allowlist setup
* Event subscription management

## Troubleshooting

Common issues and their solutions:

### Authentication Issues

* Token expiration
* Permission scope changes
* Organization access restrictions

### Webhook Problems

* Delivery failures
* Configuration errors
* Network connectivity issues

### Repository Access

* Permission denied errors
* Repository visibility conflicts
* Organization policy restrictions
