parent
31a1970b7c
commit
1fa501d508
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e -u -o pipefail
|
||||||
|
|
||||||
|
while read oldrev newrev ref
|
||||||
|
do
|
||||||
|
if [[ $ref =~ .*/main$ ]];
|
||||||
|
then
|
||||||
|
echo "main ref received"
|
||||||
|
|
||||||
|
echo "moving into temporary work tree"; {
|
||||||
|
gitdir=$PWD
|
||||||
|
cd $(mktemp -d)
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "checking out latest source"; {
|
||||||
|
git --work-tree=$PWD --git-dir=$gitdir checkout --force
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "generating static site"; {
|
||||||
|
podman compose build . --volume $PWD/.pub:/data/.pub
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "restarting server"; {
|
||||||
|
podman compose restart || podman compose up
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Reference in new issue