serial deployment

master
BuckarooBanzay 2020-11-15 19:22:37 +01:00
parent fb3711e58f
commit e38d52fedd
2 changed files with 6 additions and 1 deletions

View File

@ -25,4 +25,4 @@ jobs:
chmod 644 ~/.ssh/known_hosts
ssh-keyscan pandorabox.io >> ~/.ssh/known_hosts
# execute deployment script
cat scripts/deploy.sh | ssh root@pandorabox.io "cd /data/pandorabox.io && /bin/sh -"
cat scripts/deploy.sh | ssh root@pandorabox.io "cd /data/pandorabox.io && /bin/bash -"

View File

@ -1,6 +1,11 @@
#!/bin/sh
# deployment script for automated updates via github actions
# ensure exclusive execution with flock
LOCK_FILE=/tmp/pandorabox-deployment.lock
exec 200>"$LOCK_FILE"
flock -n 200 || exit
# get latest repo version
git pull