1 | #!/bin/bash
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | if [ "$(git branch | grep gh-pages)" != "" ]
|
7 | then
|
8 | git branch -D gh-pages
|
9 | fi
|
10 | git checkout -b gh-pages
|
11 |
|
12 |
|
13 | echo "Building..."
|
14 | webpack -p
|
15 |
|
16 | echo "Removing non-deployment files..."
|
17 | for x in $(git ls-files | grep -v "^demos/index.html$")
|
18 | do
|
19 | git rm $x
|
20 | done
|
21 |
|
22 | echo "Adding deployment files..."
|
23 | git mv demos/index.html index.html
|
24 | git add bundle*
|
25 |
|
26 |
|
27 | git commit --allow-empty -m "$(git log -1 --pretty=%B) [ci skip]"
|
28 | git push -f $(git config --get remote.origin.url) gh-pages
|
29 |
|
30 |
|
31 | git checkout -
|
32 |
|
33 | echo "Deployed."
|