Created
April 7, 2019 11:08
-
-
Save rickdaalhuizen90/f40cd88a884c12e0afadb450b419012b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
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" | |
git worktree add -B gh-pages public origin/gh-pages | |
echo "Removing existing files" | |
rm -rf public/* | |
echo "Generating site" | |
hugo | |
# commit the changes in the clone and push them back to the local gh-pages branch | |
cd public && git add --all && git commit -m "Publishing to gh-pages" && git push -u origin gh-pages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment