evennia/docs/deploy.sh

38 lines
874 B
Bash
Raw Normal View History

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 00:34:37 +02:00
mv build ..
2020-06-13 00:40:36 +02:00
# the docs/ folder is named the same in both branches so we need to step out of
# it to not confuse what's what.
2020-06-13 00:34:37 +02:00
cd ..
2020-06-13 00:19:14 +02:00
rm -Rf docs/*
2020-06-13 00:40:36 +02:00
cp -Rf build/html/versions/* docs/
2020-06-13 01:05:49 +02:00
# TODO automate this?
ln -s 1.0-dev docs/latest
2020-06-13 00:19:14 +02:00
git add docs/*
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:55:47 +02:00
mv build docs/
2020-06-13 00:07:23 +02:00
echo "Skipping deployment"
# 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
echo "Deployed to https://evennia.github.io/evennia-docs."