---
title: GitHub and CircleCI Deployment via SFTP
url: "https://pressable.com/blog/github-and-circleci-deployment-via-sftp/"
published: 2018-11-17
modified: 2025-11-10
author: Amanda Nadhir
featured_image: "https://i0.wp.com/pressable.com/wp-content/uploads/2018/11/web-developer-at-agency_t20_pYGbPY.jpg?fit=1050%2C701&ssl=1"
categories:
  - name: WordPress Tutorials
    url: "https://pressable.com/blog/category/wordpress-tutorials/?format=md"
---

The tutorial will focus on setting up CircleCI `config.yml` file to deploy the master branch of a GitHub repository via SFTP.

To follow along with this tutorial you will need:

1\. A theme or plugin that you would like to deploy. Here is a guide to WordPress plugins if you need some recommendations.

2\. Have this theme/plugin in an already existing GitHub repository.

3\. An account at CircleCI, which requires you to login using your GitHub (or BitBucket) account.

## Setting Up CircleCI

Once logged in to CircleCI, you will want to add a new project by clicking “Add Projects” on the left hand side navigation menu.

From here, you will be presented with a list of repositories in your GitHub account. Choose the repository for the theme or plugin you’d like to deploy and click “Set Up Project.” In the image below, the `pressable-theme` project is being set up for use in this tutorial.

![CircleCI dashboard for setting up a project.](https://i0.wp.com/pressable.com/wp-content/uploads/2018/10/set_up_project.png?resize=2080%2C860&ssl=1)

From here, you will be presented with a configuration screen. Choose “Linux” as the Operating System, “PHP” or “Other” as the Language, and then click “Start Building” on the bottom right hand corner.

We will be using a custom `config.yml` file, so you can safely ignore the one that gets generated for you by the site.

![CircleCI deployment dashboard with build, operating system, and language options.](https://i0.wp.com/pressable.com/wp-content/uploads/2018/10/configure_project.png?resize=2080%2C1610&ssl=1)

After this, you will need to configure a few variables that will get used by CircleCI to make connections and know where to place your plugin or theme.

You’ll need to click the settings cog on the project that you are wanting to configure variables for. In the image below, the settings cog for the `pressable-theme` project is selected.

![CircleCI project settings button.](https://i0.wp.com/pressable.com/wp-content/uploads/2018/10/settings_cog.png?resize=1139%2C666&ssl=1)

From here, click on the “Environment Variables” menu item under the “Build Settings” menu header. Then, click on “Add Variable” and add the following variables:

- **`hostname`** with value `sftp.pressable.com`
- **`username`** with value set to your [Pressable SFTP username](https://pressable.com/knowledgebase/setup-and-use-sftp-to-connect-to-your-wordpress-site/).
- **`password`** with value set to your [Pressable SFTP password](https://pressable.com/knowledgebase/setup-and-use-sftp-to-connect-to-your-wordpress-site/).
- **`site_name`** with value set to the Pressable site name you are deploying to.
- **`theme`** or **`plugin`** with value set to the name of the theme or plugin you are deploying. (Ex. `pressable-theme` in the case of this tutorial)

## Setting Up Repository

From here, we need to add our `config.yml` file to the repository you want to deploy. In order to do this, you will need to create a directory named `.circleci` in the root of your repository. Inside that directory, you will create a new file named `config.yml`. In the following `config.yml` file, you will want to replace `/wp-content/themes/` with `/wp-content/plugins` and `${theme}` with `${plugin}` if you are deploying a plugin.

Place the following inside the `config.yml` file:

Once the `config.yml` file is created inside the `.circleci` directory, you can make a push to your repository. CircleCI will see the push you made and will fire off a job using the `config.yml` file as instructions on what to do and where to deploy.

If you visit the CircleCI interface after making a push to master, you can see it spinning up the environment and deploying the repository.

From here, you can add other features to `config.yml` to make your CI setup complete.
