-
Notifications
You must be signed in to change notification settings - Fork 5
/
push.sh
executable file
·34 lines (28 loc) · 934 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
34
#!/usr/bin/env bash
# Push HTML files to gh-pages automatically.
# Fill this out with the correct org/repo
ORG=hacsoc
REPO=wiki
# This probably should match an email for one of your users.
EMAIL=hacsoc-officers@case.edu
# ^ gotta get those github contributions
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