ci(staging): revert act cache wipe, keep other aggressive cleanup
Some checks failed
Deploy Staging (terry-wallet-login) / deploy (push) Failing after 46s

Previous attempt deleted the in-flight act workspace and broke
actions/checkout. Restore the safe >60min sweep for ~/.cache/act
while keeping npm/docker/tmp/log cleanup aggressive.
This commit is contained in:
TerryM
2026-06-03 02:18:29 +08:00
parent 42b25b9e09
commit 49380dc5ed

View File

@@ -17,20 +17,12 @@ jobs:
df -h df -h
du -sh "$HOME/.cache/act" "$HOME/.npm" "$HOME/actions-runner/_work" 2>/dev/null du -sh "$HOME/.cache/act" "$HOME/.npm" "$HOME/actions-runner/_work" 2>/dev/null
# Identify current act workspace (most recently modified dir) and keep it; wipe the rest. # DO NOT touch ~/.cache/act for the current job — only sweep dirs older than 60 min.
if [ -d "$HOME/.cache/act" ]; then if [ -d "$HOME/.cache/act" ]; then
CURRENT_ACT=$(ls -1dt "$HOME/.cache/act"/*/ 2>/dev/null | head -1 || true) find "$HOME/.cache/act" -mindepth 1 -maxdepth 1 -type d -mmin +60 -exec rm -rf {} + 2>/dev/null
echo "Preserving current act dir: ${CURRENT_ACT:-<none>}"
for d in "$HOME/.cache/act"/*/; do
[ -d "$d" ] || continue
if [ "$d" != "$CURRENT_ACT" ]; then
echo "Removing stale act workspace: $d"
rm -rf "$d"
fi
done
fi fi
# Wipe npm and setup-node caches (will repopulate from registry via cache: npm) # Wipe npm and setup-node caches (cache: npm will repopulate from registry).
rm -rf "$HOME/.npm/_cacache" "$HOME/.npm/_logs" 2>/dev/null rm -rf "$HOME/.npm/_cacache" "$HOME/.npm/_logs" 2>/dev/null
rm -rf "$HOME/.cache/setup-node" 2>/dev/null rm -rf "$HOME/.cache/setup-node" 2>/dev/null
@@ -44,7 +36,7 @@ jobs:
docker system prune -af --volumes 2>/dev/null docker system prune -af --volumes 2>/dev/null
fi fi
# apt cache (if runner uses apt) # apt/yum cache
if command -v apt-get >/dev/null 2>&1; then if command -v apt-get >/dev/null 2>&1; then
sudo apt-get clean 2>/dev/null sudo apt-get clean 2>/dev/null
fi fi