How to Deploy WordPress Website Directly Through GitHub?

Some WordPress hosts let you connect your WordPress folder to a git repository in different ways.

  • One popular option is setting up a plain git repository within your project folder. It won’t be connected to any hosted version control system – but it is still a git that you can update in the same manner.
  • Others let you connect a GitHub repository right away.
  • If you have ssh access, you can also clone the GitHub repository straight to your folder and pull the changes there.

Automated deployment is also possible and usually requires ssh. Capistrano is a good option that would also help to sync your databases, handling backups, and rolling back to a previous version in case of a problem. The same process is doable with chef or Ansible. This could be combined with a CI server that handles the heavy lifting.

GitHub offers webhooks which can be connected to your VPS as well. You can listen for certain events and update your install accordingly.

Beanstalk is a version-controlled hosting platform that lets you commit code, review, and push to production with a simple button.

DeployBot is another proxy service that comes handy whenever you don’t have ssh access. You can connect the bot to a GitHub repository and set your SFTP credentials in order to automatically pass git commits through an FTP stream uploading the files to production on your behalf.