---
title: Deploy From GitHub
url: "https://pressable.com/knowledgebase/deploy-from-github/"
published: 2026-01-02
modified: 2026-05-05
author: Nox Dineen-Porter
---

The GitHub integration enables automatic deployment of your code directly from your GitHub repository to your Pressable site. This guide explains how the integration works and how to configure it for your workflow.

## **How It Works**

The GitHub integration synchronizes code from your repository to your site’s server. You can configure:

- **Repository Subdirectory**: Which folder in your repository to deploy FROM
- **Destination Path**: Where under `/htdocs `to deploy TO
- **`.deployignore` File**: Which files or folders to exclude from deployment

 
 Note: By default, the integration syncs your repository as-is. Files in your repository are deployed to the server, and files not in your repository are deleted from the server.

**WordPress core files cannot be included.** Those files are already symlinked into Pressable sites as read-only.

## **Getting Started**

### **Prerequisites**

- A GitHub account with repository access
- A Pressable site with the GitHub integration enabled (Account Settings → Sites → GitHub Integration [click here to go to your Account Settings](https://my.pressable.com/settings/sites))

 
 Note: Accounts created after December 10, 2025 use our newest GitHub integration by default, accounts created prior to that date can [contact customer support](https://pressable.com/knowledgebase/how-to-get-support-with-pressable/) to request a site be moved to the new integration

### **Initial Configuration**

1. Navigate to your site’s GitHub Integration settings in MyPressable Control Panel (MPCP) under Advanced → GitHub Integration
2. Connect your GitHub account and select your repository
3. Choose your deployment branch (typically main or master)
4. Configure your deployment paths (see below)
5. Create a `.deployignore` file if needed (see below)

![](https://i0.wp.com/pressable.com/wp-content/uploads/2026/01/github1.jpg?resize=1024%2C464&ssl=1)
 
 ![](https://i0.wp.com/pressable.com/wp-content/uploads/2026/01/github2.jpg?resize=1024%2C456&ssl=1)
 
 ## **Deployment Paths**

### **Repository Subdirectory**

The path within your repository to deploy FROM. This tells the system which folder’s contents should be synchronized.

**Common Examples**:

- Leave blank: Deploy from repository root
- `wp-content`: Deploy only the wp-content folder
- `wp-content/themes`: Deploy only themes
- `wp-content/plugins`: Deploy only plugins
- `wordpress/wp-content`: Deploy from wp-content inside a wordpress subfolder

### **Destination Path**

The path under `/htdocs` to deploy TO. This tells the system where on your Pressable site’s server the files should be placed.

**Common Examples**:

- Leave blank: Deploy to `/htdocs` (full site)
- `wp-content`: Deploy to `/htdocs/wp-content/`
- `wp-content/themes`: Deploy to `/htdocs/wp-content/themes/`
- `wp-content/plugins`: Deploy to `/htdocs/wp-content/plugins/`

### **Common Configuration Scenarios**

**Standard Setup** (`wp-content` folder in repo syncs to `wp-content` on server):

- Repository Subdirectory: `wp-content/`
- Destination Path: `wp-content/`

**wp-content as Repository Root** (your entire repo is just `wp-content`):

- Repository Subdirectory: (leave blank)
- Destination Path: `wp-content/`

**Full WordPress in Repository** (entire WordPress installation):

- Repository Subdirectory: (leave blank)
- Destination Path: (leave blank)

**Themes Only**:

- Repository Subdirectory: `wp-content/themes/`
- Destination Path: `wp-content/themes/`

**Plugins Only**:

- Repository Subdirectory: `wp-content/plugins/`
- Destination Path: `wp-content/plugins/`

## **Using `.deployignore`**

A `.deployignore` file allows you to control which files and folders are excluded from deployment. The syntax is similar to `.gitignore`.

### **When You Need `.deployignore`**

You need a `.deployignore` file if:

- You want to preserve existing server files that aren’t in your repository
- You want to exclude specific files or directories from deployment
- You need to prevent certain content from being deleted during sync

You do NOT need a `.deployignore` file if:

- You want to sync your repository as-is (everything in Git gets deployed, everything else gets deleted)
- Your repository contains exactly what should be on the server

### **Syntax Examples**

**Exclude specific files**:

`README.md`

`LICENSE`

**Exclude by file extension** (all levels):

`**/*.log`

`**/*.env`

**Exclude directories**:

`node_modules/`

`.github/`

**Exclude with wildcards**:

`wp-content/themes/twenty*/`

**Allowlist exceptions** (exclude everything in a directory except specific items):

Exclude the themes directory:

`wp-content/themes/`

BUT include your custom theme:

`!wp-content/themes/my-custom-theme/`

This example excludes all themes but allows `my-custom-theme` to deploy, preserving other server themes while deploying your custom theme from Git.

### **Creating and Deploying .deployignore**

1. Create a file named `.deployignore` at the root of your repository
2. Add your exclusion rules using the syntax above
3. Commit and push to your repository:

```
git add .deployignore

git commit -m "Add deployment exclusion rules"

git push origin main
```

 
 Warning: Ensure your `.deployignore` file is committed and pushed BEFORE activating the integration or triggering a deployment.

## **Automatic Protections**

The system automatically protects critical server-managed content, regardless of your repository or `.deployignore` configuration:

- WordPress core files (`wp-admin/`, `wp-includes/`, `wp-*.php`)
- Server-managed content (`uploads/`, `cache/`, `upgrade/`)
- Managed plugins (`pressable-onepress-login`, `jetpack`, `akismet`)
- Default themes (`twenty*`)
- Critical configuration files (`wp-config.php`, `advanced-cache.php`, `object-cache.php`)

These protections adapt based on your deployment paths.

## **Deployment Process**

### **Activating Your First Deployment**

1. Configure your deployment paths
2. Click “Save Deployment Paths” and wait for confirmation
3. Create and push your `.deployignore` file if needed
4. [Create a backup of your site](https://pressable.com/knowledgebase/how-to-manually-back-up-your-site/) (recommended)
5. Click “Set and Deploy” to trigger your first deployment

### **Monitoring Deployments**

- Check the Git History section in your GitHub Integration settings
- Successful deployments show “deployed” status
- Review your site to verify files deployed correctly (see our guides on [connecting to Pressable via SSH](https://pressable.com/knowledgebase/connect-to-ssh-on-pressable/) and [connecting to Pressable via SFTP](https://pressable.com/knowledgebase/setup-and-use-sftp-to-connect-to-your-wordpress-site/))
- If issues occur, [restore from backup](https://pressable.com/knowledgebase/restore-a-site-in-pressable-using-the-automated-restore-tool/) or [contact support](https://pressable.com/knowledgebase/how-to-get-support-with-pressable/)

### **Automatic Deployments**

After initial setup, deployments trigger automatically when you push to your configured branch. Each push creates a new deployment in your Git History.

## **Important Warnings**

**The integration syncs your repository as-is by default**:

- Files in your repository are deployed to the server
- Files NOT in your repository are deleted from the server

**Before activating**:

- Ensure your `.deployignore` file is committed if you need one
- [Create a backup](https://pressable.com/knowledgebase/how-to-manually-back-up-your-site/) if you’re unsure about your configuration
- Review your deployment paths carefully
- Test with a [staging site](https://pressable.com/knowledgebase/how-to-clone-website-to-staging/) if possible

## **Troubleshooting**

**Site is broken after deployment**:

- Restore from your pre-deployment backup
- Review your deployment paths and `.deployignore` configuration
- Contact Pressable support for assistance

**Files are being deleted unexpectedly**:

- Add appropriate rules to your `.deployignore` file
- Commit and push the changes
- Trigger a new deployment

**Deployment shows as failed**:

- Check Git History for error details
- Verify your repository structure matches your configured paths
- Contact Pressable support with your deployment ID

**No branches showing and/or “Failed connection to GitHub, please remove GitHub integration and try again” error:**

- Go to: https://my.pressable.com/settings/sites#github\_integration
- If GitHub is authorised, revoke it.
- Re-authorise it and then ensure the Pressable app is showing up as authorised under: https://github.com/settings/applications
- Retry adding the repo to your site.

## **Additional Resources**

For more information about managing your Pressable site, visit our[ Knowledge Base](https://pressable.com/knowledgebase/).
