diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 5afc3d0..8c37ad3 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -29,15 +29,28 @@ jobs: run: | set -Eeuo pipefail DEPLOY_GITEA_TOKEN="$(cat /home/deploy/.ladill-deploy-gitea-token)" - REPO_URL="${{ gitea.server_url }}/${{ gitea.repository }}.git" + # Prefer loopback — public/server_url can stall when the runner is congested. + REPO_URL="http://127.0.0.1:3000/${{ gitea.repository }}.git" rm -rf "$WORKSPACE" mkdir -p "$WORKSPACE" export GIT_TERMINAL_PROMPT=0 - git \ + attempt=1 + until git \ -c credential.helper= \ -c http.extraHeader="Authorization: token ${DEPLOY_GITEA_TOKEN}" \ clone --depth 1 --single-branch --no-tags --branch "${{ gitea.ref_name }}" \ "$REPO_URL" "$WORKSPACE" + do + if [ "$attempt" -ge 3 ]; then + echo "Checkout failed after ${attempt} attempts" >&2 + exit 1 + fi + attempt=$((attempt + 1)) + echo "Checkout retry ${attempt}/3…" + rm -rf "$WORKSPACE" + mkdir -p "$WORKSPACE" + sleep $((attempt * 5)) + done - name: Build frontend assets shell: bash {0}