Skip to content
Merged

Dev #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,17 @@ jobs:
if [ -d .git ]; then
git config --global --add safe.directory "$DEPLOY_PATH" || true
sudo git config --system --add safe.directory "$DEPLOY_PATH" || true
git fetch origin
git checkout main
git pull --ff-only origin main

# Try normal git first; fallback to sudo git when .git is root-owned.
if git -C "$DEPLOY_PATH" fetch origin; then
git -C "$DEPLOY_PATH" checkout main
git -C "$DEPLOY_PATH" pull --ff-only origin main
else
echo "Normal git fetch failed, retry with sudo git..."
sudo git -C "$DEPLOY_PATH" fetch origin
sudo git -C "$DEPLOY_PATH" checkout main
sudo git -C "$DEPLOY_PATH" pull --ff-only origin main
fi
fi

if [ ! -f "$ENV_FILE" ]; then
Expand Down
Loading
Loading