I've written before about how much we LOVE our application development workflow, with continuous integration that allows us to push changes to our code and automatically deploy to which ever environment we like, whilst the software does cool stuff like run our automated test suites.
Well, wouldn't it be great if, just at a simple level, Forge's simple static site hosting was a bit more like that too?
Currently, when you connect your Forge account to Dropbox or Github, you need to then explicitly tell Forge to redeploy your site, by clicking the button on the Version History timeline. We've been asked a lot if there's a way to automate this, so that any changes to the linked folder or repository will automatically get built and and pushed in Forge.
Well, now that's possible and I'd firstly like to show you how you can enable continuous deployments from Github - there's 2 ways:
1. The Really Easy Way
When you link your Github repository to your Forge site, you can now simply check the "Automatically re-deploy the site after a push to the repository" checkbox.
Well, it does exactly what it says on the tin.
2. The Easy Way
You can also use our Incoming Webhooks feature, to setup within your Github Repo, to trigger a re-deployment of your site whenever Github receives a push event.
To to this, login to your Github Account and locate your Repository.
Click on Webhooks & Services in the left sub-menu.
Click Add Webhook
Now you simply need to fill out one field, the Payload URL field. To fill this in, go back to your Forge site > Settings tab and grab the Webhook url by copying it to your clipboard (select the text and ctrl + c / cmd + c).
Head back to Github and paste this into the Payload URL field.
Leave the content type as "application/json"
Leave the Secret field empty.
Leave the "Just a the Push Event" selection (default).
Ensure it is Active.
Github will now automatically trigger a new deployment, and thus a new Version of your site will now be live.
This is really just the start of a new way of managing your development workflow, even for what are, quite often quite simple static websites, but being able to commit your local changes to Github and see them automatically pushed out to your Live website, is pretty cool.
But hey, what if I mess it up?
I hear you ask. You can just roll it back to the previous version with a click of a button from your Forge Version History timeline.