switch to post-receive hook for CI

main
Jonathan Dahan 11 months ago
parent 0cc5806183
commit dddb2cbd60

1
.gitignore vendored

@ -1 +1,2 @@
.pub
production.env

@ -0,0 +1,26 @@
#!/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

@ -1,2 +0,0 @@
#!/bin/sh
neocities push .pub

@ -2,7 +2,9 @@
## quickstart
## manual install
develop
zs serve --debug
build
@ -11,9 +13,10 @@ build
run
podman compose up
deploy
podman compose --profile deploy up deploy
deploy - runs a post-receive hook on the remote which pushes to neocities
git push
## todo

Loading…
Cancel
Save