1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-06 07:57:07 +00:00
kyverno/gh-pages/publish-to-gh-pages.sh

32 lines
573 B
Bash
Raw Normal View History

2019-05-12 04:16:31 -07:00
#!/bin/sh
DIR=$(dirname "$0")
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 public
mkdir public
git worktree prune
rm -rf .git/worktrees/public/
echo "Checking out gh-pages branch into public"
2019-05-12 15:13:53 -07:00
git worktree add -B gh-pages public origin/gh-pages
2019-05-12 04:16:31 -07:00
echo "Removing existing files"
rm -rf public/*
echo "Generating site"
hugo
echo "Updating gh-pages branch"
cd public && git add --all && git commit -m "Publishing to gh-pages (publish.sh)"
cd ..
echo "done!"
2019-05-12 04:16:31 -07:00