hazelnut.dev/deploy.sh

30 lines
631 B
Bash
Raw Permalink Normal View History

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
2021-03-27 10:56:16 +00:00
echo "Pulling changes on server"
ssh hazelnut.dev ./update-site.sh