Forum Discussion
CI/CD for On-Premises SQL Server using GitHub Actions
Unlike cloud-managed databases, implementing CI/CD for on-premises SQL Server is notoriously tricky, and there are few tutorials that provide an end-to-end guide. I recently built a complete three-environment pipeline (dev → test → prod) using GitHub Actions, DACPACs, and self-hosted runners, and I've documented the entire journey.
The Core Challenge: Manual deployments are error-prone. Wrong connection strings, stale artifacts, skipped validation, or deploying to the wrong environment. Every step is a failure point.
The Solution: A declarative SQL database project model where every table, view, and stored procedure lives in version-controlled .sql files. The tooling calculates what's changed and generates a DACPAC—a compiled schema artifact that's built once and deployed identically across all environments.
The Pipeline:
- CI (Pull Request): Build validates syntax and references and generates a deployment script for human review so you have an understanding of what has changed.
- CD (Merge to Main): Build the DACPAC once, then deploy automatically through dev and test, with a manual approval gate protecting the production environment.
The article walks through every step from manual deployment to a fully automated pipeline so you understand not just the what, but the why.
Read the full story here