Created
August 29, 2015 03:10
-
-
Save ninjapanzer/da20b1cc6e1a6942db7a to your computer and use it in GitHub Desktop.
Simple Shell Script to Deploy to gh-pages with bower dependencies
This file contains hidden or 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/sh | |
SOURCE_BRANCH=`git rev-parse --abbrev-ref HEAD` | |
DEST_BRANCH=gh-pages | |
git checkout $DEST_BRANCH | |
# Make sure we actually made it to the destination branch | |
if [ `git rev-parse --abbrev-ref HEAD` != $DEST_BRANCH ]; then | |
echo "!!!! Something went wrong check the errors above and try again !!!!" | |
exit 0 | |
fi | |
# Checkout code to deploy on destination branch | |
git reset --hard $SOURCE_BRANCH | |
# Prepare build dependencies | |
bower install | |
# ignore .gitignore and commit build dependencies | |
git add --force bower_components | |
git commit -m "add bower components" | |
# Overwrite the destination branch | |
git push origin $DEST_BRANCH --force | |
# Like nothing ever happened | |
git checkout $SOURCE_BRANCH |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment