Skip to content

Commit a71cc8d

Browse files
committed
production deploy script
1 parent 6b10fb2 commit a71cc8d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

deploy.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
set -e
2+
remote=mine
3+
if [[ $PRODUCTION ]]; then
4+
echo "Deploy to production? (y/n)"
5+
read ans
6+
if [[ $ans == "y" ]]; then
7+
remote="origin"
8+
fi
9+
fi
210
diffs=`git diff --name-status HEAD`
311
if [[ "" != $diffs ]]; then
412
echo "Can't deploy, unsaved changes:"
@@ -17,8 +25,6 @@ rm -rf site
1725
git add . -A
1826
git commit -m 'latest'
1927
echo "Commit created"
20-
git push --force mine gh-pages
21-
echo "Deployed to github"
28+
git push --force $remote gh-pages
29+
echo "Deployed to $remote"
2230
git checkout master
23-
24-

0 commit comments

Comments
 (0)