Skip to content

Add Render deploy step for server and nlp-service images - #2

Merged
WiderDeveloper merged 2 commits into
mainfrom
ci/add-deploy-step
Jul 22, 2026
Merged

Add Render deploy step for server and nlp-service images#2
WiderDeveloper merged 2 commits into
mainfrom
ci/add-deploy-step

Conversation

@WiderDeveloper

Copy link
Copy Markdown
Contributor

Summary

  • Picks Render ("Deploy an existing image") as the hosting target for both GHCR-published images — server (Express, :3000) and nlp-service (FastAPI, :8000). See docs/deployment.md for the full comparison against Fly.io, AWS ECS, and Vercel and why Render is the smallest fit given a private GHCR registry and no other infra requirements (no local DB — server.ts talks to an external Mujarrad backend + Gemini API).
  • Adds deploy-server / deploy-nlp-service jobs to .github/workflows/docker-publish.yml. Each runs after its image publishes on push to main and POSTs to a Render deploy hook with imgURL pinned to the commit SHA that was just built — so the running service always matches the exact published commit, not a possibly-stale :latest.
  • Both deploy jobs if:-gate on their secret being set (RENDER_DEPLOY_HOOK_SERVER / RENDER_DEPLOY_HOOK_NLP_SERVICE) and skip themselves otherwise, so merging this doesn't require the Render services to exist yet.

Not done here (needs a human with Render account access)

This repo's CI has no Render or GHCR-read credentials to provision resources with. docs/deployment.md has the full one-time setup checklist:

  1. Add a GHCR registry credential in Render (PAT with read:packages).
  2. Create the two Web Services from existing images (ports 3000 / 8000), with their real env vars (GEMINI_API_KEY, MUJARRAD_API_PUBLIC_KEY, MUJARRAD_API_SECRET_KEY, MUJARRAD_SPACE_SLUG) — those secret values live outside this repo.
  3. Copy each service's deploy-hook URL into the two GitHub Actions secrets named above.

Until that's done, the new jobs no-op (green, not red) on every push to main.

Test plan

  • YAML validated (python3 -c "import yaml; yaml.safe_load(...)")
  • After secrets are added: confirm a push to main triggers both deploy jobs and Render shows a successful deploy of the new image tag

🤖 Generated with Claude Code

WiderDeveloper and others added 2 commits July 22, 2026 13:43
Picks Render "deploy an existing image" as the hosting target for both
GHCR-published images (server on :3000, nlp-service on :8000) since it
natively supports pulling from a private registry and exposes a
deploy-hook API that CI can trigger with a specific image tag. Fly.io
and AWS were ruled out as heavier fits for this project's current stage
(see docs/deployment.md for the full comparison).

The docker-publish workflow gains deploy-server/deploy-nlp-service jobs
that POST the commit-SHA-tagged image to each service's Render deploy
hook. Both jobs no-op until RENDER_DEPLOY_HOOK_SERVER /
RENDER_DEPLOY_HOOK_NLP_SERVICE secrets exist, so this is safe to merge
ahead of the one-time Render setup, which is documented in
docs/deployment.md along with the required env vars and secrets.
GitHub Actions does not expose the `secrets` context to job-level `if:`
conditions, so `if: ... && secrets.RENDER_DEPLOY_HOOK_* != ''` made the
whole docker-publish workflow invalid (actionlint: "context 'secrets' is
not allowed here"). That would have broken all image publishing on main,
not just skipped the deploy jobs.

Gate the deploy jobs on `github.ref == 'refs/heads/main'` only, and move
the empty-secret check into the step's shell (secrets are valid in step
`env:`), exiting 0 as a no-op when the deploy hook secret isn't set. This
preserves the "safe to merge ahead of Render setup" behavior with a
mechanism GitHub actually supports.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@WiderDeveloper
WiderDeveloper merged commit 4b455da into main Jul 22, 2026
2 checks passed
@WiderDeveloper
WiderDeveloper deleted the ci/add-deploy-step branch July 22, 2026 17:05
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.

1 participant