Created
March 18, 2019 21:13
-
-
Save piecioshka/b7fba8dd30e256411892c52222d4c770 to your computer and use it in GitHub Desktop.
[deploy script]
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 | |
set -o errexit # Exit on error | |
git stash save 'Before deploy' # Stash all changes before deploy | |
git checkout deploy | |
git merge master --no-edit # Merge in the master branch without prompting | |
npm run build # Generate the bundled Javascript and CSS | |
if $(git commit -am Deploy); then # Commit the changes, if any | |
echo 'Changes Committed' | |
fi | |
git push heroku deploy:master # Deploy to Heroku | |
git checkout master # Checkout master again | |
git stash pop # And restore the changes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment