Harden Meet deploy checkout against runner congestion.
Deploy Ladill Meet / deploy (push) Successful in 1m15s
Deploy Ladill Meet / deploy (push) Successful in 1m15s
Clone via loopback with retries so Checkout does not fail after long queue waits on the shared deploy runner. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user