Episode 32 builds CI/CD for GraphQL: pipelines with GitHub Actions, automated testing, schema checks to block breaking changes, deployment automation with blue-green and canary strategies, code quality gates, and release management with semantic versioning.

CI/CD turns deployment from a nerve-racking event into an automated routine. Episode 32 builds a Continuous Integration and Continuous Deployment pipeline specifically for GraphQL projects — with all the gates that keep mistakes out of production.
We'll set up a GitHub Actions pipeline, run automated testing, apply schema checks to block breaking changes, automate deployment with blue-green and canary strategies, and manage releases with semantic versioning.
GitHub Actions runs jobs on every push or pull request:
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- run: bun run lint
- run: bun run typecheck
- run: bun run test
- run: bun run buildEquivalent alternatives: GitLab CI with .gitlab-ci.yml, CircleCI, or Jenkins — all follow the same pattern: checkout, install, lint, test, build.
Run the entire testing pyramid (episode 21) in CI: unit tests, integration tests with an in-memory database, and E2E tests for critical flows. Also add a coverage threshold so quality doesn't silently decline. For GraphQL projects, include schema testing as well.
A schema change that breaks clients is the most dangerous bug — because it won't be caught by ordinary application tests. The solution: schema checks in CI:
- name: Check schema changes
env:
APOLLO_KEY: ${{ secrets.APOLLO_KEY }}
run: npx rover graph check kalian@current --schema schema.graphqlrover graph check compares the branch schema against the production schema and blocks breaking changes. Alternative: GraphQL Inspector in CI:
- name: Schema diff
run: |
npx @graphql-inspector/cli diff \
schema/current.graphql schema/branch.graphqlWith automatic schema checks, every PR that changes the schema must pass a breaking-change review — preventing surprises for production clients.
Automated deployment needs a safe strategy:
deploy:
needs: [build, schema-check]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: bun install --frozen-lockfile
- run: bun run build
- name: Deploy ke staging
run: npx vercel deploy --prebuilt --token ${{ secrets.VERCEL_TOKEN }}Staging is always deployed automatically; production requires manual approval or a green canary metric.
A CI pipeline should block code that doesn't meet standards:
--noEmit.npm audit and Snyk.- run: bun run lint
- run: bun run typecheck
- run: npm audit --audit-level=high
- run: bun run test -- --coverageFor clean releases, apply semantic versioning (major.minor.patch) and keep an automated changelog:
npx semantic-releaseTools like semantic-release read conventional commits (episode 46) and automatically: determine the version, create the changelog, tag the release, and trigger deployment. This keeps the release history consistent and auditable — important when your users depend on API behavior.
Key takeaways:
In the next episode, episode 33, you'll learn about GraphQL Gateway and API Management — gateway architecture, Kong Gateway with plugins, AWS AppSync as a managed service, Hasura for instant GraphQL from a database, and API management with API keys and a developer portal. Your API will be ready for enterprise-scale management!