evennia/docs/deploy.sh

40 lines
992 B
Bash
Raw Normal View History

#
# 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 10:51:17 +02:00
# get the deployment branch
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-06-13 10:43:28 +02:00
# remove all but the build dir
ls -Q | grep -v build | xargs rm -Rf
2020-06-13 10:51:17 +02:00
cp -Rf build/html/versions/* .
2020-06-13 10:43:28 +02:00
# docs/build is in .gitignore so will not be included
git add .
2020-06-13 10:51:17 +02:00
# TODO automate this?
ln -s 1.0-dev latest
git add docs/*
git commit -a -m "Updated HTML docs"
2020-06-13 10:51:17 +02:00
mv build docs/
echo "Skipping deployment"
# git push origin gh-pages
2020-06-13 10:51:17 +02:00
# get back to previous branch
2020-06-13 10:43:28 +02:00
git checkout -
echo "Deployed to https://evennia.github.io/evennia-docs."