-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis-deploy.sh
36 lines (27 loc) · 931 Bytes
/
.travis-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
#!/bin/bash
# Originally from https://gist.github.com/domenic/ec8b0fc8ab45f39403dd, with my
# modifications for webpack.
SOURCE_BRANCH="master"
TARGET_BRANCH="gh-pages"
# Save some useful information
REPO=`git config remote.origin.url`
SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:}
SHA=`git rev-parse --verify HEAD`
SUPER_REPO="https://$GH_TOKEN@github.com/yellowdoge/demos.git"
# Run WebPack to generate a bundled client-side js file.
webpack --display-error-details
mkdir out
cd out
git init
git config user.name "Travis CI"
git config user.email "miguelecasassanchez@gmail.com"
cp -f ../mediarecorder/demo.bundle.* ./
cp -f ../imagecapture.html ./ic.html
cp -f ../imagecapture2.html ./ic2.html
cp -f ../imagecapture2.css ./
cp -f ../w3.css ./
cp -f ../dimsum.js ./
cp -rf ../resources ./
git add .
git commit -m "Auto deploy ${SHA} to GitHub pages branch"
git push --force --quiet $SUPER_REPO master:gh-pages