Using WP Pusher and GitHub releases to deploy custom WordPress pluginsMarch 18, 2017
WP Pusher 1 is my favorite product in the WordPress ecosystem so far. It helps you automatically deploy plugins and themes from a remote Git repository to a WordPress installation. Why do we need a tool for that? Well, here is the plot twist: You do not need Git or SSH access on the server WordPress is running on. In fact you need nothing but WordPress, which means it works on shared hosting and that is exactly what we are using it for at WebKinder. It uses some of WordPress internal update mechanism in order to perform the updates from Git. But it goes further than that, it really helped us improve the way we update and deploy custom plugins. I am sure that we will make further tweaks to this, but for now I am really happy with the following process:
- Develop the plugin using Git, GitHub and whatever branching model you like.
- Tag all version bumps on the master branch as releases on GitHub.2
- Use WP Pusher’s push-to-deploy functionality to automatically update the plugin on new releases.
By default, push-to-deploy will run on all commits pushed to the Git repository. That means each time anything changes on the master branch, WordPress will pull in the new code. I have used this configuration for a while, but recently discovered that you can customize the events that trigger an update through GitHub’s webhook settings. Within your repository, go to Settings – Webhooks and find this:
Now you can select individual events and decide when to run an update of your plugin through WP Pusher. What I do is simply uncheck push and check Release instead. Now every release will automatically be deployed to all sites that run this plugin.