From 07327b906f5417e3329116df68be3d6339d3e82a Mon Sep 17 00:00:00 2001 From: cesnimda Date: Fri, 10 Jul 2026 21:58:29 +0200 Subject: [PATCH] deploy: poll-based auto-deploy script (cron fallback for the runner) Co-Authored-By: Claude Opus 4.8 --- deploy/autodeploy.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 deploy/autodeploy.sh diff --git a/deploy/autodeploy.sh b/deploy/autodeploy.sh new file mode 100644 index 0000000..9aa5ff6 --- /dev/null +++ b/deploy/autodeploy.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# Poll-based auto-deploy: pull main and rebuild the stack when it changes. +# ponytail: 1-minute cron poll, not a webhook — swap for the Gitea runner +# (.gitea/workflows/deploy.yml) once the runner's job image has the Docker CLI + socket. +set -e +REPO=/home/pi/resumesite +exec 9>/tmp/resumesite-deploy.lock +flock -n 9 || exit 0 # a build is already running +cd "$REPO" +git fetch -q origin main +[ "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)" ] && exit 0 +git reset -q --hard origin/main +docker compose -f deploy/docker-compose.yml up -d --build --remove-orphans