-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.sh
41 lines (33 loc) · 939 Bytes
/
build.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
#!/usr/bin/env bash
if [ ${TRAVIS_BRANCH} != 'master' ]; then
exit 0
fi
# Set identity
git config --global user.email "travis@travis-ci.org"
git config --global user.name "Travis"
# Update dist files
./node_modules/.bin/gulp clean
./node_modules/.bin/gulp
# Change remote
git remote remove origin
git remote add origin https://${GH_TOKEN}@github.com/elboletaire/tabbedcontent.git
git fetch origin
# Ensure we're not on a detached branch
git checkout master
# Commit and push
git add -f dist/tabbedcontent.min.js
git commit -m "Update dist files [skip ci]"
git push origin master
# prepare gh-pages
git clone --branch gh-pages --depth 1 \
https://${GH_TOKEN}@github.com/elboletaire/tabbedcontent.git \
../gh-pages
# remove all its content
rm -frv ../gh-pages/demos
# copy what we want
cp -frv dist/demos ../gh-pages
cd ../gh-pages/
# Push generated files
git add .
git commit -m "Update gh-pages"
git push origin gh-pages