diff options
author | Anthony Wang | 2024-12-13 23:31:15 -0500 |
---|---|---|
committer | Anthony Wang | 2024-12-13 23:31:15 -0500 |
commit | cbae31e0d7f2b23dc7b75b878b102519bb47e59f (patch) | |
tree | dbcb1957fecd91ee6ef77235a4b264810b962f5e /static | |
parent | 442aca698326694420a8e75a1de7b0149a8e94fe (diff) |
Make description of build process on about page more accurate and link to post-receive hook
Diffstat (limited to 'static')
-rw-r--r-- | static/src/post-receive | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/static/src/post-receive b/static/src/post-receive new file mode 100644 index 0000000..9276a99 --- /dev/null +++ b/static/src/post-receive @@ -0,0 +1,19 @@ +# Skip build if using git push with -o or --push-option +if [[ -v GIT_PUSH_OPTION_0 ]]; then + exit +fi + +# Solution to +# remote: fatal: not a git repository: '.' +# https://git-scm.com/docs/githooks#_description +unset GIT_DIR +cd $(git worktree list | grep master | cut -d' ' -f1) +git submodule update + +# Manually copy static since btrfs COW is super fast +cp -r static /srv/http/tmp +hugo --destination /srv/http/tmp + +# Replace with new build +rm -r /srv/http/www +mv /srv/http/tmp /srv/http/www |