Skip to content

Instantly share code, notes, and snippets.

@beckler
Created February 21, 2019 16:29
Show Gist options
  • Save beckler/057b956b9dc80150f9153ee2230260b0 to your computer and use it in GitHub Desktop.
Save beckler/057b956b9dc80150f9153ee2230260b0 to your computer and use it in GitHub Desktop.
Easy hugo deploy to github pages
#!/bin/bash
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# build the project -> outputs to public folder
hugo --minify --buildFuture
# commit the public folder
git add public && git commit -m "Update content"
# push the public folder ONLY to the gh-pages branch
git subtree push --prefix public origin gh-pages
echo -e "\033[0;32mFinished deploying.\033[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment