What gets deployed to production is not your source code but a build artifact : an immutable snapshot your pipeline produced from it, such as a Docker image, a compiled Next.js output, a Java JAR or a serverless package. Production servers never pull your repository or compile TypeScript on demand. They run the artifact. That one idea explains rollbacks, environment changes and most of CI/CD.
Part 4 of the Modern Deployments series. Previous: serverless cold starts .
What happens between git push and production?
A simplified pipeline looks like this:
git push β clone repository β install dependencies β compile / transpile β bundle and optimise β run tests β create build artifact β deploy artifact
Enter fullscreen mode
Exit fullscreen mode
The interesting part isn't the pipeline.β¦