-
-
Save amazingandyyy/c0d190ef3fff2e3193dddc6c2b7ad23a to your computer and use it in GitHub Desktop.
Deploy to target branch (e.g. gh-pages)
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/bash | |
set -e # stop on error | |
echo get last commit | |
git pull | |
echo add dist folder | |
git add -f dist | |
echo commit changes | |
git commit -m "deploy to gh-pages" | |
echo push to remote target branch (gh-pages is target branch) | |
git push origin `git subtree split --prefix dist`:gh-pages --force | |
echo reset commit | |
git reset --hard HEAD^ | |
echo push to develop | |
git push | |
echo All done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment