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: