How to deploy to your sites using Git

What You Need to Start

In order to begin, you will need the following already setup:

  • A repository in GitHub for an existing site with a /wp-content/ directory in its root. Example:
  • plugins/ and/or themes/ directory inside /wp-content/
  • The repository in question hosted at GitHub (More providers will be available in the future).
  • The HTTPS URL for the repository you will be deploying from.

Getting Your HTTPS URL

Navigate to the repository you are interested in deploying and click on the green “Code” button. Make sure under the clone title you have selected “HTTPS” or that the header says “Clone with HTTPS” before copying the HTTPS URL.

Github clone tab with HTTPs url selected

Connecting to Pressable

Navigate to your https://my.pressable.com dashboard. Create a new site or select an existing site you want to connect. Click on the Git tab from the single site page:

Pressable Git Integration Settings

Paste the URL you copied from GitHub into the field and click Set Repository URL to connect.

Authorizing

The page will refresh and you will need to click Authorize to authorize Pressable to interact with this repository:

Once you click “Authorize,” you will be prompted to login to GitHub and authorize this interaction.

Github authorization

Selecting the Branch

After you have authorized the application, you’ll be returned to your MyPressable Dashboard and you will now have the ability to select a branch from your repository. This is the branch that you want to deploy to Pressable servers for the site you are configuring.

Pressable Git Branch Selection

As soon as you set a branch, you’ll want to configure the branch settings below.

Branch Settings

The branch settings allow you the flexibility to choose if you wish to synchronize your plugins and/or themes directories.

Additionally, you can decide whether to delete theme files and/or plugin files that are not present in the depository.

Once your preferred your settings are toggled, click the Set and Deploy button. Going forward, anytime you push to the specified branch, we will receive notice and automatically deploy the changes to your site.

You can monitor the status of your deployments on the GitHub History section underneath the integration settings:

Organizations & third-party application access policy

If you are attempting to connect Git with a private repository under an organization, or have multiple organizations under your account, then you’ll want to make sure that the proper settings are set. If you are experiencing issues with Git connecting to the wrong organizations or not allowing you to select a branch, then you’ll want to follow the steps below:

  1. Access the main GitHub account settings here.
  2. Under Integrations click on Applications
  3. Then click on the Authorized OAuth Apps tab
  4. Under Organization Access you’ll see Organization access with all of your organizations listed.

Clicking on the Grant button next to the corresponding organization will enable connection to any private repo under that organization.

Restrictions

  • We currently do not pull down WordPress Core files or the /wp-content/uploads directory.
  • Unless enabled for theme and plugin directories, Git deploys currently do not delete files from the site when it syncs. Only file additions or changes are deployed.