Skip to content
MCP

Chapter 12 Β· Operate

CI/CD

Automate quality and deployment. The existing workflow lints, compiles, tests, and scans for secrets. The recommended production pipeline adds schema and infrastructure validation, image builds, deployment gates, and post-deploy smoke tests.

🎯 What you'll be able to do

  • Understand what the existing CI workflow runs
  • Design a production pipeline with deployment gates
  • Explain why GitHub Actions OIDC beats long-lived Azure secrets

The existing workflow

.github/workflows/ci.yml runs, on each change:

  1. checkout
  2. Python setup
  3. install the package with dev dependencies
  4. ruff lint
  5. compileall syntax check
  6. pytest
  7. gitleaks secret scan
Every stage is a gate. A failure stops promotion before it reaches production.
Production note
The two highest-value additions over basic CI are connector-schema validation (catches a broken MCP connector before users do) and post-deploy smoke tests (catches a bad deploy automatically).

Use OIDC, not stored secrets

❓ Concept check

Why place Bicep validation and connector schema validation before merge, rather than only at deploy time?

πŸ“Œ Chapter summary

  • Current CI: install, ruff lint, compileall, pytest, gitleaks secret scan.
  • Production pipeline adds connector-schema and Bicep validation, Docker build, deployment to dev via OIDC, smoke tests, manual approval, then prod.
  • Use OIDC federation instead of storing Azure credentials.

βœ… End-of-chapter review

0/3 done