From 013a67481f9cf8dc924740b7e6fd49bc5f1e5f42 Mon Sep 17 00:00:00 2001 From: Kpa-clawbot <259247574+Kpa-clawbot@users.noreply.github.com> Date: Fri, 27 Mar 2026 09:34:16 -0700 Subject: [PATCH] ci: add Go staging auto-deploy to CI pipeline Build and deploy the Go staging container (port 82) after Node staging is healthy. Uses continue-on-error so Go staging failures don't block the Node.js deploy. Health-checks the Go container for up to 60s and verifies /api/stats returns the engine field. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/deploy.yml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 44c16f2b..cef7b65a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -246,13 +246,47 @@ jobs: curl -f http://localhost:81/api/nodes || exit 1 echo "Staging smoke tests passed" + - name: Deploy Go staging + continue-on-error: true + run: | + echo "Building Go staging image..." + docker compose --profile staging-go build staging-go + + echo "Replacing Go staging container..." + docker rm -f meshcore-staging-go 2>/dev/null || true + docker compose --profile staging-go up -d staging-go + + # Wait for healthy — Go starts fast, 60s is generous + for i in $(seq 1 60); do + HEALTH=$(docker inspect meshcore-staging-go --format '{{.State.Health.Status}}' 2>/dev/null || echo "starting") + if [ "$HEALTH" = "healthy" ]; then + echo "Go staging healthy after ${i}s" + break + fi + if [ "$i" -eq 60 ]; then + echo "WARNING: Go staging did not become healthy within 60s" + docker logs meshcore-staging-go --tail 30 + exit 1 + fi + sleep 1 + done + + # Verify API responds with engine field + if curl -sf http://localhost:82/api/stats | grep -q engine; then + echo "Go staging verified — engine field present" + else + echo "WARNING: Go staging /api/stats did not return engine field" + exit 1 + fi + - name: Promotion instructions run: | echo "## Staging Deployed ✓" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "**Commit:** \`$(git rev-parse --short HEAD)\` — $(git log -1 --format=%s)" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY - echo "**Staging URL:** http://:81" >> $GITHUB_STEP_SUMMARY + echo "**Node Staging:** http://:81" >> $GITHUB_STEP_SUMMARY + echo "**Go Staging:** http://:82" >> $GITHUB_STEP_SUMMARY echo "" >> $GITHUB_STEP_SUMMARY echo "To promote to production:" >> $GITHUB_STEP_SUMMARY echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY