forked from sphinx-gallery/sphinx-gallery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs_deploy.sh
executable file
·40 lines (31 loc) · 988 Bytes
/
docs_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
37
38
39
40
#!/bin/sh
# ideas used from https://gist.github.com/motemen/8595451
# abort the script if there is a non-zero error
set -e
# show where we are on the machine
pwd
siteSource="$1"
if [ ! -d "$siteSource" ]
then
echo "Usage: $0 <site source dir>"
exit 1
fi
# now lets setup the docs repo so we can update them with the current build
git config --global user.email "Circle CI" > /dev/null 2>&1
git config --global user.name "[email protected]" > /dev/null 2>&1
git clone [email protected]:sphinx-gallery/sphinx-gallery.github.io.git
cd sphinx-gallery.github.io/
# copy over or recompile the new site
git rm -rf .
cp -a "../${siteSource}/." .
# github nojekyll
touch .nojekyll
# stage any changes and new files
git add -A
# now commit
git commit --allow-empty -m "Update the docs from master"
# and push, but send any output to /dev/null to hide anything sensitive
git push --force --quiet origin master > /dev/null 2>&1
# go back to where we started
cd ..
echo "Finished Deployment!"