You need a webhook receiver for GitHub that triggers deployments. Design it.
AdvancedScenarioTesting, CI/CD, packaging & services
Answer
Situation read → Public endpoint that can deploy to production.
What I'd do →
- FastAPI or Flask endpoint verifying
X-Hub-Signature-256with HMAC-SHA256 over the raw body andhmac.compare_digest. - Filter events (
X-GitHub-Event: pushonrefs/heads/main, orreleasepublished). - Deduplicate on
X-GitHub-Delivery; enqueue a job and return 202 within GitHub's 10-second timeout. - A worker performs the deploy idempotently and reports status back (commit status or deployment API).
- Restrict ingress to GitHub's published hook IP ranges (from
api.github.com/meta) as an extra layer.
Why → Signature, dedupe, and async processing are the three properties a deploy webhook needs.
Interview tip → Ask whether a pull-based model (Argo CD) removes the need for an inbound webhook.
More on Testing, CI/CD, packaging & services
You join a team whose Python automation repo has no tests. Where do you start?BeginnerYour pytest suite takes 12 minutes. How do you speed it up?IntermediateA test passes locally but fails in CI only when run with the rest of the suite. What do you suspect?IntermediateYou want a reusable CI pipeline for 15 Python tool repos. What goes in it?IntermediateYour Python Docker image is 1.1 GB. How do you shrink it?IntermediateYou want to distribute an internal CLI to 200 engineers. What are your options?Intermediate