You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
521 B
28 lines
521 B
#!/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
|