Git post commit hooks with Jekyll
Creating a Jekyll blog is both fun and easy. I was amazed how easy it was to get started and get something up and running in a couple minutes!
If you don’t already have a Jekyll blog you can get started here: github.com/mojombo/jekyll
After I got something I was happy with, I wanted to make it super easy to deploy my blog. I created a post commit hook so every time I commit my blog it would publish it up to my site.
Adding the following lines of code to .git/hooks/post-commit and making the file executable did the trick!
echo "--- Creating site ---" jekyll --pygments echo "--- Uploading site ---" scp -r _site/* (username)@(example.com):directory/