Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Simple GitHub Pages-like deployment to a custom server.
#!/usr/bin/env bash
cd /home/web/site_orig
git pull origin 4.0
echo 'Building Jekyll site.'
bundle install && rake build
rm -rf /home/web/site/*
cp -r _site/* /home/web/site/
echo 'Done!'
#!/usr/bin/env node
var port = 8080;
var branch = '4.0';
var hook = require('hookshot');
console.log('Listening on port ' + port + ' for webhooks...');
hook('refs/heads/' + branch, 'echo "Recieved webhook!" && ./build.sh').listen(port);
console.log('Ready for webhooks!');
{
"name": "jekyll-hook",
"version": "0.0.1",
"description": "GitHub Pages-like builds for a custom server.",
"main": "start.js",
"dependencies": {
"forever": "~0.11.1",
"hookshot": "0.0.2"
},
"devDependencies": {},
"scripts": {},
"author": "Jesse Herrick",
"license": "MIT"
}
#!/usr/bin/env node
var forever = require('forever');
forever.startDaemon('hook.js');
console.log('Jekyll hook process started!')
#!/usr/bin/env node
var forever = require('forever');
forever.stopAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment