UNPKG

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