Skip to content

Commit 0961efe

Browse files
committed
put in fancy script for building gh-pages
1 parent 8071ca8 commit 0961efe

File tree

1 file changed

+28
-7
lines changed

1 file changed

+28
-7
lines changed

Sources/build_gh_pages.sh

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,35 @@
33
# simple script to build and push to gh-pages
44
# designed to be run from master
55

6+
# this version used a separate copy of the repo in a parallel dir
7+
# to keep the gh-pages branch nicely separate from the main branch.
8+
# this makes it easier to have the index.html in the root dir
9+
# -- to be nicely served by gh-pages
10+
11+
12+
GHPAGESDIR=../../PythonTopics_gh_pages
13+
14+
# make sure gh-pages dir is there -- exit if not
15+
if [ ! -d $GHPAGESDIR ]; then
16+
echo "To build the gitHub pages, you must first create a parallel repo: $GHPAGESDIR"
17+
exit
18+
fi
19+
20+
# make sure that the main branch is pushed, so that pages are in sync with master
21+
git push
22+
23+
# make sure the gh pages repo is there and in the right branch
24+
pushd $GHPAGESDIR
25+
git checkout gh-pages
26+
popd
27+
628
# make the docs
729
make html
8-
930
# copy to other repo (on the gh-pages branch)
10-
cp -R build/html/ ../../PythonTopics_gh_pages/
31+
cp -R build/html/ $GHPAGESDIR
1132

12-
cd ../../PythonTopics_gh_pages
13-
git checkout gh-pages
14-
git add * # in case there are new files added
15-
git commit -a
16-
git push
33+
pushd $GHPAGESDIR
34+
git add . # in case there are new files added
35+
git commit -a -m "updating rendered version"
36+
git pull -s ours --no-edit
37+
git push --set-upstream origin gh-pages

0 commit comments

Comments
 (0)