2020-09-09 02:36:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
if [ "`git status -s`" ]
|
|
|
|
then
|
|
|
|
echo "The working directory is dirty. Please commit any pending changes."
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Deleting old publication"
|
|
|
|
rm -rf .deploy
|
|
|
|
mkdir .deploy
|
|
|
|
git worktree prune
|
|
|
|
rm -rf .git/worktrees/-deploy/
|
|
|
|
|
|
|
|
echo "Checking out gh-pages branch into public"
|
2021-02-26 19:02:34 +00:00
|
|
|
git worktree add -B rendered .deploy origin/rendered
|
2020-09-09 02:36:52 +00:00
|
|
|
|
|
|
|
echo "Generating site"
|
|
|
|
zola build
|
|
|
|
cp -r public/* .deploy/
|
|
|
|
|
|
|
|
echo "Updating gh-pages branch"
|
2021-02-26 19:02:34 +00:00
|
|
|
cd .deploy && git add --all && git commit -m "Publishing to rendered (deploy.sh)"
|
2020-09-09 02:36:52 +00:00
|
|
|
|
|
|
|
echo "Pushing to github"
|
|
|
|
git push --all
|