-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy.sh
executable file
·44 lines (35 loc) · 1.02 KB
/
deploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
echo "Target: gh-pages branch"
ORIGIN_URL=`git config --get remote.origin.url`
ORIGIN_URL_WITH_CREDENTIALS=${ORIGIN_URL/\/\/github.com/\/\/[email protected]}
git config --global user.name "JimTheMan" || exit 1
git config --global user.email "[email protected]" || exit 1
echo "Cleaning up temp files"
# rm -Rf $TEMP_DIRECTORY
echo "Deploying..."
git push origin :gh-pages
git commit -am 'commit from paris, france.'
git subtree push --prefix ng-s/dist/ origin gh-pages || {
echo "something bad happened"
echo "deleting gh-pages"
git branch -D gh-pages
echo "checking out orphan"
git checkout --orphan gh-pages
echo "adding"
git add --all
echo "committing"
git commit -m 'gh-pages commit!!'
echo "pushing gh-pages"
git push origin gh-pages
echo "checking out master"
git checkout master
echo "entering SafeFoods"
cd ng-s
echo "building dist folder"
npm run build:prod
echo "deleting old gh-pages"
git push origin :gh-pages
echo "pushing dist!"
cd ..
git subtree push --prefix ng-s/dist/ origin gh-pages
}
echo "Deployed."