fix: CI always pulls latest before fallback to local repo

The actions/checkout fails (Gitea token issue) and falls back to
~/archy local copy. But local copy was stale — builds were missing
fixes. Now: always git pull in local repo before rsync fallback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-04-02 19:15:54 +01:00
parent 4820995bfb
commit aa957d0e87

View File

@ -15,6 +15,19 @@ jobs:
with:
fetch-depth: 1
clean: true
continue-on-error: true
- name: Sync from local repo (fallback when checkout fails)
run: |
# Always pull latest in local repo so fallback is current
cd /home/archipelago/archy && git pull origin main 2>/dev/null || true
# If checkout failed (no .git), copy from local repo
if [ ! -d ".git" ] || [ ! -f "core/archipelago/Cargo.toml" ]; then
echo "Checkout failed — syncing from local repo"
rsync -a --delete --exclude='.git' --exclude='target/' --exclude='node_modules/' \
/home/archipelago/archy/ ./ 2>/dev/null || cp -a /home/archipelago/archy/* . 2>/dev/null
fi
echo "Source version: $(grep '^version' core/archipelago/Cargo.toml 2>/dev/null)"
- name: Build backend
run: |