Skip to content

Instantly share code, notes, and snippets.

@toddsby
Last active March 1, 2017 00:27
Show Gist options
  • Save toddsby/9b2e26ab6c510d2f38ca04a533e62527 to your computer and use it in GitHub Desktop.
Save toddsby/9b2e26ab6c510d2f38ca04a533e62527 to your computer and use it in GitHub Desktop.
Git deploy post-receive hook (production)
#!/bin/bash
while read oldrev newrev refname
do
branch=$(git rev-parse --symbolic --abbrev-ref $refname 2> /dev/null)
if [ "master" = "$branch" ]; then
(cd /home/tufandr/public_html/mightty && git --git-dir /home/tufandr/repos/mightty/.git --work-tree /home/tufandr/public_html/mightty checkout master -f && yarn && node_modules/.bin/gulp && node_modules/.bin/gulp 6to5ifyProd)
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment