From 43e25f714053e6b659eb32a76aaae7f9e7267d7a Mon Sep 17 00:00:00 2001 From: Mohmmed Elfateh Sabry <59346303+elfateh4@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:00:43 +0300 Subject: [PATCH] Enhance deployment script to force reset local changes and pull latest from main branch --- .github/workflows/deploy.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 769b640..978ed5d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -42,12 +42,12 @@ jobs: "export REMOTE_DIR='${{ secrets.REMOTE_DIR }}'; bash -se" <<'EOF' set -euo pipefail cd "$REMOTE_DIR" - # Force reset any local changes regardless of git status + # Force reset any local changes and pull latest if [ -d ".git" ]; then - echo "Git repository detected, resetting changes..." - git reset --hard HEAD 2>/dev/null || true - git clean -fd 2>/dev/null || true - git checkout main 2>/dev/null || git checkout master 2>/dev/null || true + echo "Git repository detected, resetting and pulling..." + git reset --hard HEAD + git clean -fd + git pull origin main else echo "No git repository found, creating backup of modified files..." # Backup any existing files that might conflict