Skip to content

Instantly share code, notes, and snippets.

@tiernano
Created January 16, 2013 06:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tiernano/4545178 to your computer and use it in GitHub Desktop.
Save tiernano/4545178 to your computer and use it in GitHub Desktop.
post-receive hook for GIT to generate site using Jekyll and then push to NFSN using RSYNC. dont forget the / at the end of public_www or a new directory will be created in your public folder... if you want the contents uploaded to the public folder, include the /!
GIT_REPO=$HOME/repositories/<sitename>.git
TMP_GIT_CLONE=$HOME/tmp/<sitename>
PUBLIC_WWW=/var/wwwsites/<sitename>/
git clone $GIT_REPO $TMP_GIT_CLONE
cd $TMP_GIT_CLONE && jekyll --no-auto $TMP_GIT_CLONE $PUBLIC_WWW
cd ~ && rm -rf $TMP_GIT_CLONE
rsync -avz -e ssh $PUBLIC_WWW <NFSNUSERNAME>@ssh.phx.nearlyfreespeech.net:/home/public/
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment