Spaces:
Sleeping
Sleeping
Seth McKnight
commited on
Commit
·
9627f08
1
Parent(s):
df316c5
ci: treat Render 'live' status as success in deploy polling (#7)
Browse files
.github/workflows/main.yml
CHANGED
|
@@ -126,11 +126,14 @@ jobs:
|
|
| 126 |
resp=$(curl -s -H "Authorization: Bearer ${RENDER_API_KEY}" "https://api.render.com/v1/services/${RENDER_SERVICE_ID}/deploys/${deploy_id}")
|
| 127 |
status=$(echo "$resp" | jq -r '.status')
|
| 128 |
echo "Deploy status: $status"
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
| 131 |
exit 0
|
| 132 |
fi
|
| 133 |
-
|
|
|
|
| 134 |
echo "Deploy failed; response:"
|
| 135 |
echo "$resp"
|
| 136 |
exit 1
|
|
|
|
| 126 |
resp=$(curl -s -H "Authorization: Bearer ${RENDER_API_KEY}" "https://api.render.com/v1/services/${RENDER_SERVICE_ID}/deploys/${deploy_id}")
|
| 127 |
status=$(echo "$resp" | jq -r '.status')
|
| 128 |
echo "Deploy status: $status"
|
| 129 |
+
# Treat common Render success-like statuses as success so we proceed.
|
| 130 |
+
# Examples observed: "success", "succeeded", "live", "ready".
|
| 131 |
+
if echo "$status" | grep -E -i '^(success|succeeded|live|ready)$' >/dev/null 2>&1; then
|
| 132 |
+
echo "Deploy succeeded (status=$status)"
|
| 133 |
exit 0
|
| 134 |
fi
|
| 135 |
+
# Treat common failure-like statuses as failure.
|
| 136 |
+
if echo "$status" | grep -E -i '^(failed|error|failed_with_errors)$' >/dev/null 2>&1; then
|
| 137 |
echo "Deploy failed; response:"
|
| 138 |
echo "$resp"
|
| 139 |
exit 1
|