forked from ionic-team/ionic-site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·40 lines (35 loc) · 1009 Bytes
/
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
#!/bin/bash
# note, the first time you run this on your computer, you'll need to run this a second time
# steps:
# make a change to the site under the master branch
# commit and push that change
# fetch all, making sure that you're tracking gh-pages
# run this script
MASTER_DIR=$PWD
PAGES_DIR=$PWD/_site
# Let CI servers with a GH_TOKEN variable do their work
if [[ "$GH_TOKEN" != "" ]]; then
GH_ORIGIN=https://driftyco:[email protected]/driftyco/ionic-site
else
[email protected]:driftyco/ionic-site.git
fi
# delete gh-pages branch if it exists
git branch | grep gh-pages && git branch -D gh-pages
rm -rf $PAGES_DIR
git clone $GH_ORIGIN $PAGES_DIR
cd _site
git checkout --orphan gh-pages
rm -rf *
git add --all
git commit -m "prep for deploy"
git remote rm origin
git remote add origin $GH_ORIGIN
cd $MASTER_DIR
gulp sass
jekyll build
cd $PAGES_DIR
git add --all
git commit -m "Content creation"
# Push quietly so the token isn't seen in the CI output
git push -fq origin gh-pages
cd ..