Skip to content

Harden develop CD deploy step with retry on transient health-check failure#2313

Draft
taejinn with Copilot wants to merge 2 commits into
developfrom
copilot/fix-build-and-deploy-job
Draft

Harden develop CD deploy step with retry on transient health-check failure#2313
taejinn with Copilot wants to merge 2 commits into
developfrom
copilot/fix-build-and-deploy-job

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The build-and-deploy GitHub Actions job was failing in the remote deploy phase even though build and artifact transfer succeeded. Logs show intermittent health-check timeout behavior ending with deploy script exit before Nginx switch.

  • What changed

    • Updated .github/workflows/backend-cd-develop.yml in Run deploy script on develop server.
    • Replaced single-shot deploy invocation with a bounded retry loop (2 attempts, 30s backoff).
    • Preserved fail-fast semantics after the final attempt (exit 1) so real persistent failures still fail the job.
  • Why this addresses the failure mode

    • The failing run pattern indicates transient startup/health-check instability rather than deterministic build or transfer errors.
    • A single controlled retry absorbs brief warm-up variance without weakening failure signaling.
  • Snippet (workflow change)

    script: |
      for attempt in 1 2; do
        echo "> Deploy attempt ${attempt}/2"
        if ${{ secrets.DEVELOP_DEPLOY_SCRIPT_PATH }}; then
          echo "> Deploy succeeded on attempt ${attempt}"
          exit 0
        fi
        if [ "${attempt}" -lt 2 ]; then
          echo "> Deploy script failed. Retrying in 30 seconds..."
          sleep 30
        fi
      done
      echo "> Deploy failed after retries."
      exit 1

Copilot AI changed the title [WIP] Fix failing GitHub Actions job build-and-deploy Harden develop CD deploy step with retry on transient health-check failure Jul 24, 2026
Copilot AI requested a review from taejinn July 24, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants