forked from IPGP/scientific_python_cheat_sheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
30 lines (21 loc) · 723 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
#!/usr/bin/env bash
# deploy script for travis-ci, inspired by: https://github.com/steveklabnik/automatically_update_github_pages_with_travis_example
set -o errexit -o nounset
if [ "$TRAVIS_BRANCH" != "master" ]
then
echo "This commit was made against the $TRAVIS_BRANCH and not the master! No deploy!"
exit 0
fi
rev=$(git rev-parse --short HEAD)
cp index.html _site/
cd _site/
git init
git config user.name "MMesch"
git config user.email "MMesch@users.noreply.github.com"
git remote add upstream "https://$GH_TOKEN@github.com/IPGP/scientific_python_cheat_sheet.git"
git fetch upstream
git reset upstream/gh-pages
touch .
git add -A .
git commit -m "rebuild pages at ${rev}"
git push -q upstream HEAD:gh-pages