Skip to content

Commit 234c915

Browse files
committed
Retry Hugging Face deploy on transient errors
1 parent a551777 commit 234c915

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

.github/workflows/deploy-space.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,17 @@ jobs:
6767
if [ "${{ inputs.create_pr }}" = "true" ]; then
6868
args+=(--create-pr)
6969
fi
70-
uvx --from git+https://github.com/meta-pytorch/OpenEnv.git openenv push "${args[@]}"
70+
71+
for attempt in 1 2 3; do
72+
echo "Hugging Face push attempt ${attempt}/3"
73+
if uvx --from git+https://github.com/meta-pytorch/OpenEnv.git openenv push "${args[@]}"; then
74+
exit 0
75+
fi
76+
if [ "${attempt}" -lt 3 ]; then
77+
echo "Push failed, retrying after backoff..."
78+
sleep $((attempt * 20))
79+
fi
80+
done
81+
82+
echo "::error::Failed to push to Hugging Face Space after 3 attempts"
83+
exit 1

0 commit comments

Comments
 (0)