From b322e003bec007177fe9fee9adaafb670a9ecf68 Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 6 Feb 2026 19:23:19 +0000 Subject: [PATCH] Replace rsync with git pull in CI workflow Rsync was leaving dirty working trees on the deploy server, causing git pull conflicts during manual deploys. Use git fetch + reset instead. Co-Authored-By: Claude Opus 4.6 --- .gitea/workflows/ci.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 0057d77..a0a0ed3 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: - name: Install tools run: | - apt-get update && apt-get install -y --no-install-recommends openssh-client rsync + apt-get update && apt-get install -y --no-install-recommends openssh-client - name: Set up SSH env: @@ -28,18 +28,15 @@ jobs: chmod 600 ~/.ssh/id_rsa ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true - - name: Sync code to server + - name: Pull latest code on server env: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} run: | - rsync -avz --delete \ - --exclude '.git' \ - --exclude '__pycache__' \ - --exclude '*.pyc' \ - --exclude '.pytest_cache' \ - --exclude 'venv' \ - --exclude '.env' \ - ./ "root@$DEPLOY_HOST:/root/art-dag/celery/" + ssh "root@$DEPLOY_HOST" " + cd /root/art-dag/celery + git fetch origin main + git reset --hard origin/main + " - name: Build and push image env: