Help articles General Questions

How can I use Git to publish my site on Flywheel

Flywheel recommends storing themes and code in a version control system like Git, and supports deploying from Git using DeployHQ. (HINT: this is how we deploy the getflywheel.com site).

DeployHQ allows you to set up all types of manual and automatic deployment for your sites. It supports Git, Mercurial, and Subversion code repositories, and can deploy to many types of destinations including FTP/SFTP, Amazon S3, and more.

For the purposes of deploying to Flywheel, we are going to focus on using DeployHQ to deploy a Git repository to your Flywheel site via SFTP.

screenshot_git_0

In order to utilize DeployHQ to publish your Git repo to Flywheel, you will need the following prerequisites:

1

A Git repo containing your WordPress code / theme.

We recommend Github or Bitbucket for Git hosting

2

A DeployHQ account

The free account is good for 1 project and 10 deploys / day

The steps for connecting DeployHQ and Flywheel are simple, and take just a few minutes to set up. Once you’re set up, you can choose from two types of deployments:

Manual deployment To deploy your code, you log into the DeployHQ dashboard and initiate the deployment manually
Automatic deployment Your code will be deployed to Flywheel automatically on each commit

The method used is up to you, and you can switch at any time.

To get started, log in to your DeployHQ account and create a new project:

screenshot_git_1

From there, add the details of your Git repository. You can either specify the full URL of the repository, or for Github and Bitbucket you can enter your username / password and DeployHQ will automatically pull a list of your repos:

screenshot_git_2

Once you’ve selected your repository, you will need to configure the server for the deployment. These are the settings for your Flywheel site that will be the destination for the files that are deployed from your Git repo.

 screenshot_git_3

Settings

Name The name of the destination server Example: Flywheel Site
Protocol SSH/SFTP
Hostname sftp.flywheelsites.com
Port 22
Username Your Flywheel username. Note: This is NOT your email address
Password Your Flywheel password
Use SSH Keys for authentication? Unchecked
Path on server The full path on the Flywheel SFTP server where you’d like to deploy to. Example: /username/my-flywheel-site/wp-content/themes/my-theme

Deployment Options

Notification Email Address Your email address
Branch to deploy from The branch you’d like to deploy from. (Example: master)
Environment The name you’d like to give this environment. (Example: Production)
Subdirectory to deploy from The subdirectory in your repo that corresponds to the destination path on the server. (Example: wp-content/themes/my-theme)

Note

It’s important that the settings for the Path on server and Subdirectory to deploy from are correct. These two must match up, or else you risk deploying the wrong files.

Flywheel recommends deploying only your theme. You cannot deploy your entire WordPress installation, as Flywheel write-protects the core WordPress files.

The final step to configuring DeployHQ to deploy to your Flywheel account is to create a deployment. To do so, select the server you just created, and select which revisions you’d like to commit.

Note

If this is your first deployment, we recommend deploying all changes. To do so, leave the first field blank, and in the second field make sure it’s the latest commit. This will bring over all changes in the repo.

screenshot_git_4

Clicking “Run Deployment” will take your code from the Git repository, and will deploy it to your Flywheel site via SFTP. Once the deployment is complete, you will be notified by email, and your changes will be live on Flywheel! 

Warning

Configuring a deployment with Git + DeployHQ will overwrite any files uploaded normally via SFTP. If you choose to do this, you should stop updating themes via SFTP, and only do so via Git. 

screenshot_git_5

To run this deployment in the future, you simply need to log into your DeployHQ account, and click the “Deploy Now” button, and all the latest committed changes will be pulled from your Git repo and deployed to your Flywheel account.


  • Organizations

    Everything you need to know about managing your team with our Organizations feature.

    8 Articles
  • Blueprints

    Learn everything there is to know about what Blueprints are, how to create them and how to make the best use of them.

    5 Articles
  • Simple SSL

    All there is to know about our free, automatically installed and activated SSL certificates.

    8 Articles
  • Staging

    How to get the most out of Staging, which allows you to duplicate a site, make changes, and then push those changes to the live site.

    6 Articles
  • Local by Flywheel

    Everything you need to know about our amazing, free local WordPress development software for Mac and PC.

    5 Articles
  • White Label

    Everything you need to know about our Whitelabel subscriptions for branding and reselling Flywheel.

    4 Articles
  • Getting started

    Everything you need to know to get your first Flywheel site up and running.

    8 Articles
  • Frequently Asked

    The most commonly asked questions, and a few we just think you should know.

    24 Articles
  • General Questions

    Questions that don't fit elsewhere, or those about Flywheel in general.

    56 Articles
  • Billing & Accounts

    Questions relating to payments, billing and managing your account on Flywheel.

    12 Articles
  • Domain Names

    Details about how to manage DNS and point your domain names at Flywheel.

    10 Articles
  • Database

    How to access your WordPress database to make changes and update content.

    3 Articles
  • Security

    Details about everything Flywheel does to makes your site so secure.

    12 Articles
  • Plugins

    Which plugins work best, which plugins work worst, and everything in between.

    7 Articles

Get in touch with us

Standard support hours are M-F 9am-5pm CDT and 24/7 emergency support.

WordPress experts

Try it yourself. It's free & takes less than 60 seconds. Sign up

× How to manage 50+ WordPress Sites

Here's a free ebook!

How to manage 50+ WordPress Sites