Skip to content

Instantly share code, notes, and snippets.

@divergentdave
Created December 26, 2020 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save divergentdave/31060e84c888e48a90016684f3f17168 to your computer and use it in GitHub Desktop.
Save divergentdave/31060e84c888e48a90016684f3f17168 to your computer and use it in GitHub Desktop.
NearlyFreeSpeech.net Jekyll post-receive git hook
#!/bin/bash
REPONAME='davidsherenowitsa.party'
export GEM_HOME=/home/protected/gems
PATH=$PATH:/home/protected/gems/bin
GIT_REPO=$HOME/$REPONAME.git
TMP_GIT_CLONE=$HOME/tmp_clone/$REPONAME
TMP_OUTPUT=$HOME/tmp_output/$REPONAME
PUBLIC_WWW=/home/public
JEKYLL_ENV=production
git clone $GIT_REPO $TMP_GIT_CLONE
cd $TMP_GIT_CLONE
bundle install
bundle exec jekyll build --source $TMP_GIT_CLONE --destination $TMP_OUTPUT
cd -
rm -Rf $TMP_GIT_CLONE
rsync -r --delete --exclude=/.well-known --exclude=/keybase.txt --exclude=/firew
orks --exclude=/registrars $TMP_OUTPUT/ $PUBLIC_WWW/
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment