Skip to content

Instantly share code, notes, and snippets.

@ulysses4ever
Created June 29, 2014 12:36
Show Gist options
  • Save ulysses4ever/5ab89633ef4b29ef5c5f to your computer and use it in GitHub Desktop.
Save ulysses4ever/5ab89633ef4b29ef5c5f to your computer and use it in GitHub Desktop.
#!/bin/bash
cd
mkdir site-repo.git
cd site-repo.git
git --bare init
cat << EOF > hooks/post-receive
#!/bin/bash
GIT_REPO=$HOME/site-repo.git
TMP_GIT_CLONE=$HOME/tmp/repo
TMP_WWW=$HOME/tmp/site
PUBLIC_WWW=$HOME/public_html
git clone $GIT_REPO $TMP_GIT_CLONE
jekyll build -s $TMP_GIT_CLONE -d $TMP_WWW
rm -Rf $TMP_GIT_CLONE
cp -r $TMP_WWW/* $PUBLIC_WWW
rm -Rf $TMP_WWW
EOF
chmod 775 post-receive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment