forked from geo-python/site
-
Notifications
You must be signed in to change notification settings - Fork 0
/
push.sh
executable file
·33 lines (27 loc) · 895 Bytes
/
push.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
#!/usr/bin/env bash
# Push HTML files to gh-pages automatically.
# Fill this out with the correct org/repo
ORG=geo-python
REPO=site
# This probably should match an email for one of your users.
EMAIL=david.whipp@helsinki.fi
set -e
# Clone the gh-pages branch outside of the repo and cd into it.
cd ..
git clone -b gh-pages "https://$GH_TOKEN@github.com/$ORG/$REPO.git" gh-pages
cd gh-pages
# Update git configuration so I can push.
if [ "$1" != "dry" ]; then
# Update git config.
git config user.name "Travis Builder"
git config user.email "$EMAIL"
fi
# Copy in the HTML. You may want to change this with your documentation path.
cp -R ../$REPO/build/html/* ./
# Add and commit changes.
git add -A .
git commit -m "[ci skip] Autodoc commit for $COMMIT."
if [ "$1" != "dry" ]; then
# -q is very important, otherwise you leak your GH_TOKEN
git push -q origin gh-pages
fi