Skip to content

Instantly share code, notes, and snippets.

@brigleb
Last active August 29, 2015 14:04
Show Gist options
  • Save brigleb/4c2f51cae46ce6964637 to your computer and use it in GitHub Desktop.
Save brigleb/4c2f51cae46ce6964637 to your computer and use it in GitHub Desktop.
Pseudo Code for WordPress Client Theme Deploy

The goal here is to have a script of some kind that lets you "deploy" your WordPress theme to GitHub, and the auto-updater plugin that supports GitHub will then pull the latest tagged release on your master branch onto your website.

We want to try replacing FTP-based methods for deployment, while having a record of each deployment to our sites. Presumably, this would be more useful for the "staging" site. On the production site, you might want to update the theme in a more manual (and less frequent) fashion.

1. Update version number in style.css and elsewhere.

I am theorizing that we want to increment a global variable in functions.php

2. Checkout master branch, merge

Need to include all code from the develop (or other) branch that is normally ignored. This includes things like compiled CSS, JS, and so forth. It should be set up to automatically let the master branch win if there are conflicts.

3. Commit to master

This may happen with the merge anyway. Be sure to write a good message.

4. Tag that commit

The tagged commit will be picked up by the updater. Can this match the "release notes?"

5. On the website, you then visit the plugin page and click to update the theme.

You might also have it auto-update.

You will need the github-updater plugin to be installed and configured.

6. Return to your old branch

You leave your changes on master, they should never be merged back in to where you're working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment