Files
ResumeSite/deploy/autodeploy.sh
T
cesnimda 2952c957ca
CI / quality (push) Has been cancelled
CI / e2e (push) Has been cancelled
CI / lighthouse (push) Has been cancelled
CI / relay (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
CI / images (push) Has been cancelled
deploy: self-locating autodeploy (path-independent)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 22:03:59 +02:00

14 lines
655 B
Bash

#!/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=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) # repo root, wherever this lives
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