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