Github Deploy script

Getting my site deployment / update workflow working properly is something I just recently decided to take seriously.  For years I’d been deploying sites using whatever method was available and took my fancy at the time, and updating and editing them directly via FTP.  

I knew this wasn’t exactly ideal, but it worked well enough for me most of the time.  It was quick enough and usually the worst that would happen is the client’s site would be unavailable for a couple of minutes. 

However, I knew that if I was to be serious about my business, I should put something better (and preferably version controlled) in place.  

So I finally did.  I wanted to use GitHub if at all possible, as I really like using (g)it and now that even the cheapest non-free plan includes unlimited private repos, I wanted to make use of that.  I had used Alex Lixandru’s BitBucket Sync on a couple of occasions before, and wanted something similar, but for GitHub instead.  I was aware of Beanstalk and a couple of other paid options but I also really wanted something that didn’t require a paid subscription.  I took a look around and couldn’t find anything that fitted the bill.  (Though I’ve come across several worthy options since then, such as Wanchai’s FTPBucket.  My Google-Fu must’ve not been functioning properly at the time.)

Anyway, I decided porting BitBucket Sync to GitHub was the way to go.  And that’s how GitHub Deploy was born.  
I’ve made some improvements, including adding an admin page (idea and most of the code for this taken from FTPBucket).

While there aren’t many files involved, getting it set up and working can be a bit of a hassle.  Somehow I just find it really difficult to follow my own instructions, so I keep missing out on something important and it doesn’t work.  I might see if I can add in some setup help tests to assist with this.

However, once you’ve got it set up and functioning correctly, it works like a charm.  Any changes pushed to the specified repo branch will be pushed to the server as well.  
If a change-set is large, the deployment might not complete, in which case a full deploy can be run to ensure the repo and server are in sync.

Judging from the lack of stars on the project, it seems I’m probably the only person in the world using it at the moment.  If you need something like this, I encourage you to give it a try and let me know!  
I’m definitely open to suggestions on what to improve and fix.


Leave a Reply

Your email address will not be published. Required fields are marked *