diff --git a/hooks/post-receive b/hooks/post-receive deleted file mode 100755 index ec0f270..0000000 --- a/hooks/post-receive +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -set -e -u - -while read oldrev newrev ref -do - if [[ $ref =~ .*/main$ ]]; then - echo "main ref received" - - echo "moving into temporary work tree"; { - gitdir=$PWD - cd ~/jonathan.is - } - - echo "checking out latest source"; { - git --work-tree=$PWD --git-dir=$gitdir checkout --force - } - - echo "generating static site"; { - podman-compose build - } - - echo "restarting server"; { - podman-compose up --detach - } - - echo "updating post-receive hook for future runs"; { - cp hooks/post-receive $0 - } - fi -done diff --git a/hooks/pre-push b/hooks/pre-push new file mode 100755 index 0000000..4ec61ae --- /dev/null +++ b/hooks/pre-push @@ -0,0 +1,2 @@ +#!/bin/sh +neocities push .pub