Seth McKnight commited on
Commit
9627f08
·
1 Parent(s): df316c5

ci: treat Render 'live' status as success in deploy polling (#7)

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yml +6 -3
.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
- if [ "$status" = "success" ]; then
130
- echo "Deploy succeeded"
 
 
131
  exit 0
132
  fi
133
- if [ "$status" = "failed" ]; then
 
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