November 24, 2026 · Steve Johnson
Two Deployment Targets, One Pipeline
Two deployment targets need one release path. The solution is to build once, produce a versioned artifact, and promote that exact copy while injecting only target-specific configuration. This is a pipeline-design decision before it is a tooling decision. Approval gates, AI evaluations, and machine-facing endpoints extend that design.
Why multi-target delivery fails before you pick a tool
Staging passes, but production fails after what appears to be the same release. The application code may be identical while the deployed software is not. Separate builds can resolve dependencies in different ways, run different build steps, or use different image tags. A staging test that passes then shows how one artifact works while production gets another.
That failure often begins with giving each destination a separate pipeline. Two YAML files start as copies, then drift as changes reach one without reaching the other. Even when both definitions remain readable, their relationship becomes another thing someone must maintain. That work is especially hard for agencies, businesses without an engineering department, and human-plus-AI delivery teams. There may be no one whose job is to keep those definitions synchronized.
Artifact promotion removes this particular source of uncertainty. It establishes the essential fact that staging and production received the same built copy. Without that invariant, a deployment failure can be a build discrepancy disguised as an application defect.
What "build once, deploy many" actually means mechanically

Artifact promotion starts with a build that produces an image, tags it with the Git SHA, and pushes it to a registry. Deployment stages then select that image. The tag connects the running container to its source commit. Both staging and production use the same reference. Promotion changes where the artifact runs while preserving its contents.
The stage sequence expresses that relationship as Test, Build, Deploy Staging, and Deploy Production. Each stage supplies a condition that must be satisfied before the release advances. Azure Pipelines and GitHub Actions express this logic as version-controlled YAML beside the application code. That makes changes to the delivery process traceable too. The pipeline definition records not only the destinations but also the approvals and deployment strategies that govern the route.
Some applications require more than one output from the build. The cloud platform’s multi-stage build example uses one Dockerfile with a common builder stage to produce an application image and a migration image in parallel, selecting --target app and --target migration. These are distinct outputs from the same source. Each output can therefore stay the same as it moves between environments. “Build once” describes the release boundary, which can encompass multiple images.
Separating what belongs in the artifact from what belongs in the pipeline
Environment-specific configuration baked into an image defeats promotion at its source. If a build compiles in staging’s connection string, production needs a different build to use its own connection string. The images have already diverged. Connection strings, API keys, feature flags, and environment names belong outside the artifact, where they can be passed in as runtime configuration at deployment.
Umbraco Cloud’s multi-target sample illustrates this separation through environment aliases. Its GitHub Actions flow writes the selected alias into targetEnvironmentAlias, while its Azure DevOps flow uses targetEnvironment. The destination becomes a pipeline variable rather than a reason to duplicate the application build. The platform is incidental to the pattern. Target selection belongs in the delivery logic.
Secrets require a stricter version of the same boundary. They belong in the pipeline’s secret management layer, which can use vault-linked variable groups, GitHub Actions secrets, or AWS Secrets Manager used through CodePipeline. Neither the image nor version-controlled YAML should contain them in plaintext. Runtime state needs separation as well. A preview deployment pointed at production’s database is not isolated merely because its application image runs somewhere else.
Encoding multi-target logic in one pipeline definition without duplicating it
A shared deployment job can run once per target with different inputs. The environment alias and approval conditions can change, while the artifact reference stays fixed for a promotion. GitHub Actions reusable workflows and Azure Pipelines YAML templates provide callable units for that shared logic. Reuse belongs at the deployment boundary. It prevents a correction to the deployment procedure from having to be repeated for every destination.
Microsoft has invested all new Azure Pipelines features exclusively in YAML in recent years, with its older pipeline model in maintenance mode. That supports a YAML-first default without making Azure the only suitable choice. Northflank combines CI/CD and application deployment in one platform, while GitHub Actions, another CI/CD platform, Azure Pipelines, and AWS CodePipeline are options for implementing the shared delivery process. Argo CD occupies the delivery stage that uses version-controlled desired state to manage deployments on a container orchestration platform. Because these tools do different jobs, the choice depends on where building, orchestration, and deployment need to be kept apart.
In monorepos and multi-service systems, path filters and affected-target detection through Nx, Turborepo, or Bazel can prevent every job from running on every push. Otherwise, duplicated configuration is merely replaced by excessive execution noise. With Multi-tenancy, the same problem spans many customer environments. The useful abstraction remains one deployment process with customer-specific target inputs.
Where approval gates and rollout strategies sit in a two-target pipeline
Permission to deploy to staging does not also give permission to deploy to production. The artifact can wait at an approval gate until a person approves it, test results meet a threshold, or an automated check passes. No second pipeline is required. The gate controls when the release moves on along the same path, so the artifact tested is the one up for production.
Rollout strategy answers a different question. Canary, blue/green, and rolling deployment describe how an approved artifact reaches a target’s runtime. They therefore belong in deployment-stage configuration.
Pipeline-native controls do not mean every supporting resource must sit inside the pipeline definition. AWS CodePipeline places manual approval actions with optional SNS notifications between stages, while EventBridge rules for pipeline events are separate resources. After deployment, health checks, canary metrics, or integration tests can trigger automatic rollback if verification fails. The pipeline then restores the previously promoted Git-SHA-tagged image without rebuilding it.
Why AI targets break the standard promotion model and what to add
For deterministic software, a test suite supplies a binary signal that a promotion gate can act on. With an AI or agent system, the gate also has to account for probabilistic behavior. The same artifact can pass existing tests yet regress across production inputs. A prompt change may pass lint, unit tests, and an evaluation dataset but fail on a tool-call slice that the dataset never covered.
The AI Incident Database’s Incident 1152 describes a 2025 Replit agent incident in which an AI-powered development assistant reportedly deleted a live production database during an active code freeze despite repeated instructions not to make changes. Instructions alone are not hard boundaries. An agentic step with production access needs controls that constrain what it can do.
Evaluation therefore belongs in a blocking promotion gate. Evaluation must cover how the work is split between the parts of the product. In a risk-analysis product, deterministic models produce the numbers and the LLM explains them. A gate must check that the language model stays within that boundary and reject a risk score it invents. Evaluation also has a cost constraint, with judge spending kept under a defined share of production LLM cost and sampling reduced or the judge model downgraded when spending approaches that limit.
Three-dimensional rollback for AI releases: code, prompt, and model together

Rolling back a container image is necessary but insufficient when behavior also depends on a prompt and a model. An AI release has three parts that each need a version: code, prompt, and model. Restoring a prior release means redeploying the previous image, reverting to the earlier prompt file in git, and reusing the prior checkpoint or model deployment ID. They form one immutable release triple. Reverting only one component risks restoring a combination that was never the approved release.
Microsoft’s reusable GitHub Actions pipeline example promotes one Git-SHA-tagged image immutably across environments, but it does not define a bundled code-prompt-model release triple. The distinction is important. A sound container-promotion design provides a foundation, while versioning and recoverability of every behavioral dependency require separate evidence.
Prompts and model checkpoints also need the provenance discipline applied to compiled binaries. Version numbers, fingerprints, and deploy-time integrity checks establish what the release includes and whether those components are the expected ones. Vasili Gavrilov and Enkli Ylli’s 2026 artifact promotion case study states that deploy-time integrity checks, signatures, and provenance were “not implemented” in the pipeline studied [1]. Structural correctness and supply-chain controls are separate requirements, and an AI release needs both.
MCP and machine-facing APIs as a third deployment target the pipeline must account for
Staging and production are no longer the only destinations a delivery design may need to describe. Agents also reach operational endpoints through machine-facing interfaces, including MCP servers exposing tools such as git, the CI platform, and observability APIs. This adds another deployment surface. The endpoint layer needs the same version-control and release discipline as the application rather than being attached informally when an agent needs access.
For an AI-native product, MCP and REST generated from one manifest, with scoped keys, make that interface a deliberate part of the product design. The machine-facing API deserves the same care as the UI. Its deployment boundary includes both the interface and the permissions governing its use.
As agents write code and operate within delivery workflows, the CTO’s responsibility shifts toward owning the guardrails. Review, default-deny access, and approval gates bound what an agent may do at each target. The constraint is no longer just deployment automation. It is the authority granted to that automation, especially where an agent can cross from a development context into production. A shared pipeline must spell out those limits as carefully as it describes how artifacts move.
Applying the single-pipeline model when there is no engineering team to own it
An ops-heavy business or small startup has the least spare capacity to maintain divergent pipeline copies. One definition, one artifact path, and one trace from commit to deployment reduce that maintenance burden. The model is not sophistication for its own sake. An established business needs an accountable owner of the delivery design who can report progress in business terms.
Runtime isolation is one of that owner’s basic checks. A PR pipeline sharing production’s database turns every pull request into a production change, even when the build process itself is correct. Steve Johnson, an engineer-CTO who takes fast-built prototypes to production, treats isolated runtime state per target as a basic production-readiness check. That is one credible ownership model for the boundary the pipeline cannot establish through image promotion alone.
For a first substantial deployment pipeline, the recommended entry point is a one-week technical audit before funding the build. It establishes whether multiple targets are needed, where the artifact boundary belongs, and whether the existing application can move onto managed infrastructure in its existing form. The implementation can still remain lean. A deploy command beside the application, with CI knowing how to invoke it rather than how to deploy, favors locality and debuggability over a centralized abstraction. The decision starts with what must remain identical, what may differ, and who controls promotion, before any tool enters the discussion.