-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f467e79
commit 2c1c84b
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x # un-comment to see what's going on when you run the script | ||
|
||
GITHUB_REPONAME="whitemech/LydiaSyft" | ||
|
||
# Create a temporary directory and store its name in a variable. | ||
TEMPD=$(mktemp -d) | ||
|
||
# Exit if the temp directory wasn't created successfully. | ||
if [ ! -e "$TEMPD" ]; then | ||
>&2 echo "Failed to create temp directory" | ||
exit 1 | ||
fi | ||
|
||
# generate documentation | ||
doxygen Doxyfile | ||
|
||
# copy generated HTML documentation in the temporary folder | ||
cp -r ./docs/html/* "$TEMPD" | ||
|
||
# move to temporary directory | ||
CURDIR=$(pwd) | ||
cd $TEMPD | ||
|
||
# set up Git in temporary directory | ||
git init | ||
git checkout -b gh-pages | ||
git add . | ||
git commit -m "Deploy documentation" | ||
|
||
git remote add origin "[email protected]:${GITHUB_REPONAME}.git" | ||
|
||
# Push files | ||
git push origin gh-pages --force | ||
|
||
# return to previous directory | ||
cd $CURDIR | ||
|
||
# Make sure the temp directory gets removed on script exit. | ||
trap "exit 1" HUP INT PIPE QUIT TERM | ||
trap 'rm -rf "$TEMPD"' EXIT |