Deploying Jekyll sites with GitLab2015-09-22
This site1 uses Jekyll to generate static pages, which I manage using GitLab. I was using a hacked-together local Git hook to regenerate the site and copy the files to my webserver’s root directory after each commit, but I wanted a solution that both worked no matter where I was commiting and pushing changes from and didn’t involve PHP.2
The obvious solution is a Web hook. I found a couple of PHP scripts that probably would have worked, but I really wasn’t in the mood to klutz around with my kinda-working PHP configuration. I then found git-fish, a Node.js web hook listener. Luckily, my quick-and-dirty bash script still works fine. Here’s a blank example you can use:3
Once you’ve done this, configure git-fish to listen on a certain port (and make sure that port’s open on the firewall), have it call the script when it recieves an event, and you should be done!
- ...which, so far, is 100% self-documentation ⏎
- I don't like PHP much. More importantly, I wasn't in the mood to fight with my semi-broken but also generally-working nginx/php-fpm setup, since that might break it harder. ⏎
- Helpful code critiques can be emailed to me. Unhelpful ones should be forwarded to /dev/null ⏎