Created
March 15, 2018 02:57
-
-
Save bronzehedwick/09269494cfea444f212887fde2bf7eff to your computer and use it in GitHub Desktop.
Git post receive hook to deploy a hugo site
This file contains hidden or 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 | |
GIT_DIR=/path/to/hugo/source | |
WEB_DIR=/path/to/webroot | |
# pull the latest code. | |
git --git-dir "$GIT_DIR/.git" --work-tree "$GIT_DIR" pull origin master | |
git --git-dir "$GIT_DIR/.git" --work-tree "$GIT_DIR" checkout --force | |
# build the site. | |
hugo --source "$GIT_DIR" --destination "$WEB_DIR" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment