Add Render deploy step for server and nlp-service images - #2
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
server(Express, :3000) andnlp-service(FastAPI, :8000). Seedocs/deployment.mdfor 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).deploy-server/deploy-nlp-servicejobs to.github/workflows/docker-publish.yml. Each runs after its image publishes on push tomainand POSTs to a Render deploy hook withimgURLpinned to the commit SHA that was just built — so the running service always matches the exact published commit, not a possibly-stale:latest.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.mdhas the full one-time setup checklist:read:packages).GEMINI_API_KEY,MUJARRAD_API_PUBLIC_KEY,MUJARRAD_API_SECRET_KEY,MUJARRAD_SPACE_SLUG) — those secret values live outside this repo.Until that's done, the new jobs no-op (green, not red) on every push to
main.Test plan
python3 -c "import yaml; yaml.safe_load(...)")maintriggers both deploy jobs and Render shows a successful deploy of the new image tag🤖 Generated with Claude Code