2020-04-05 00:02:02 +02:00
|
|
|
#
|
|
|
|
|
# deploy to github
|
|
|
|
|
#
|
|
|
|
|
# This copies the recently built files from build/html into the github-gh branch. Note that
|
|
|
|
|
# it's important that build/ must not be committed to git!
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
if [ -n "$(git status --untracked-files=no --porcelain)" ]; then
|
|
|
|
|
echo "There are uncommitted changes. Make sure to commit everything in your current branch first."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2020-06-13 00:40:36 +02:00
|
|
|
# get the deployment branch
|
2020-04-05 00:02:02 +02:00
|
|
|
git checkout gh-pages
|
2020-06-13 10:43:28 +02:00
|
|
|
# at this point we should be inside the docs/ folder of the gh-pages branch,
|
|
|
|
|
# with the build/ directory available since this is not in git
|
2020-04-05 00:02:02 +02:00
|
|
|
|
2020-06-13 10:43:28 +02:00
|
|
|
# remove all but the build dir
|
|
|
|
|
ls -Q | grep -v build | xargs rm -Rf
|
|
|
|
|
|
2020-06-13 12:21:34 +02:00
|
|
|
cp -Rf build/html/* .
|
2020-06-13 01:05:49 +02:00
|
|
|
# TODO automate this?
|
2020-10-19 08:55:53 +02:00
|
|
|
ln -s 0.9.5 latest
|
2020-11-14 19:15:24 +01:00
|
|
|
ln -s 0.9.5/index.html .
|
2020-06-13 01:05:49 +02:00
|
|
|
|
2020-06-13 12:27:45 +02:00
|
|
|
# docs/build is in .gitignore so will not be included
|
|
|
|
|
git add .
|
|
|
|
|
|
2020-04-05 00:02:02 +02:00
|
|
|
git commit -a -m "Updated HTML docs"
|
2020-06-13 00:40:36 +02:00
|
|
|
|
2020-06-13 00:07:23 +02:00
|
|
|
echo "Skipping deployment"
|
2020-06-13 12:35:15 +02:00
|
|
|
git push origin gh-pages
|
2020-04-05 00:02:02 +02:00
|
|
|
|
2020-06-13 00:55:47 +02:00
|
|
|
# get back to previous branch
|
2020-06-13 00:40:36 +02:00
|
|
|
git checkout -
|
2020-04-05 00:02:02 +02:00
|
|
|
|
2020-06-13 12:41:55 +02:00
|
|
|
echo "Deployed to https://evennia.github.io/evennia/"
|