A deployment records a particular software version as available in a runtime environment, such as production. In Pact, recording it tells the contract-testing system which version currently occupies that environment. section 10.2.4 section 10.5
Deployment and release differ in how earlier versions are treated. A deployment marks previous versions as not deployed, so only one version is recorded as deployed. A release leaves earlier versions marked as released, which suits products such as mobile apps where multiple versions remain in use. section 10.2.4
A deployment workflow commonly:
- Identifies the consumer or provider version with a unique value such as a GitHub commit SHA. section 10.3 section 10.5
- Records the version against a Pact environment after the deployment completes, commonly restricting the CI step to the main branch. section 10.2.4
- Uses the recorded deployment when selecting versions for contract verification or checking whether a subsequent version is safe to deploy. section 10.2.4 section 10.5
Recording a production deployment
A CI job can run pact-broker record-deployment for the WebConsumer and MoviesAPI, passing each participant, $GITHUB_SHA, and the production environment. The workflow records these versions after contract tests and displays them as available in production. A later can-i-deploy check can query whether a candidate version has a successful verification result with the version already deployed there. section 10.2.4 section 10.5
"scripts": {
…
"record:web:consumer:deployment":
"pact-broker record-deployment
--pacticipant WebConsumer --version $GITHUB_SHA
--environment production",
"record:provider:deployment":
"pact-broker record-deployment --pacticipant MoviesAPI
--version $GITHUB_SHA --environment production"
…
}
Shows the package scripts that record consumer and provider versions as deployed to production. section 10.2.4






















