tags:

views:

92

answers:

1

I have jekyll blog up and running locally. I am not sure how to push the content to slicehost. They have an instruction page but I am not able to follow the instruction.

I have all my content on github. Just need to know how to make post-update hook work?

+1  A: 

To deploy a generated Jekyll site, you just need to copy the contents of the local _site directory to the appropriate remote directory on your server (often public_html, but it depends on the server configuration).

Personally, I think the easiest way is to just use rsync, assuming you can use rsync with your server. Then it's as simply as executing the command

$ rsync -avz --delete _site/ user@host:/path/to/web/root

to deploy your site. For my Jekyll-based sites, I encapsulate this in a Rake task so I can just do

$ rake site:deploy

to copy the site to the server.

If you can't use rsync, you can always transfer the _site directory via FTP, which is also pretty easy to do (and with a bit of Ruby scripting, can be automated using Rake as well).

You can use Git, as noted in the Jekyll docs. You will have to have Git installed on your server, and access to using it. If that's the case, you have to create a bare Git repo on your server. In the bare repo, you then create a post-update hook to check out the latest copy of the site. You do this by creating a script at $BARE_REPO/hooks/post-update with contents like the following (as noted here):

#!/bin/sh
unset GIT_DIR && cd /path/to/web/root && git pull

You then clone the bare repository to your web root, like so:

$ cd /path/to/web/root
$ cd ..
$ rm -rf root
$ git clone /path/to/bare/repo.git root

As you can see, it's often easier to use rsync or FTP instead of Git.

mipadi