-
-
Save goodguyry/60661091c2bb68d9574c to your computer and use it in GitHub Desktop.
Git Post-Receive Hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Source/PATH to match login shell | |
source $HOME/.rvm/scripts/rvm | |
PATH="$PATH:$HOME/.nvm/v0.10.35/bin" | |
PATH="$PATH:$HOME/.rvm/bin" | |
# Variables | |
WORK_TREE=$HOME/path/to/working-tree | |
REPO_DIR=$HOME/path/to/bare-repo.git | |
PRODUCTION_ROOT=$HOME/path/to/live-root | |
echo "post-receive running.." | |
git --work-tree=$WORK_TREE --git-dir=$REPO_DIR checkout -f | |
cd $WORK_TREE | |
# Set Sass style to compressed | |
grunt environment:prod | |
# Build | |
jekyll build --destination $PRODUCTION_ROOT | |
# Set Sass style back to expanded | |
grunt environment:dev | |
echo "post-receive done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment