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.
27 lines
518 B
27 lines
518 B
#!/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 "building and deploying site"; {
|
|
podman-compose --profile deploy build
|
|
}
|
|
|
|
echo "updating post-receive hook for future runs"; {
|
|
cp hooks/post-receive $0
|
|
}
|
|
fi
|
|
done
|