Pipelines
Environments and manual approval
Record deployments to named environments, and hold a job until a person releases it.
Available in repositories branchd reads pipeline files for. It is switching repositories on one at a time: until yours is, it keeps running its
.forge-ci.yamlor.xeonr-ci.yaml. See What is available.
# .branchd/pipelines/ci.yaml
# Deploy to production only after a person releases the job. It waits up
# to a day, then is skipped; the run is not held open for it.
name: CI
on:
push:
branches: [main]
jobs:
test:
image: golang:1.26
steps:
- run: go test ./...
deploy-stage:
needs: [test]
image: alpine:3
environment: {name: stage, url: 'https://stage.app.example.com'}
secrets: [DEPLOY_TOKEN]
steps:
- run: ./scripts/deploy.sh stage
deploy-production:
needs: [deploy-stage]
image: alpine:3
environment: {name: production, url: 'https://app.example.com'}
concurrency: {group: production}
manual:
wait: 24h
on-expiry: skip
blocking: false
secrets: [DEPLOY_TOKEN]
steps:
- run: ./scripts/deploy.sh production
environment:is a name, or{name, url}. Each run of the job records a deployment to it.manual:holds the job until a person releases it.manual: truewaits without limit. The long form is{wait, on-expiry, blocking}:waithow long to wait (24h),on-expirywhat happens then (failorskip), andblocking: falselets the rest of the run finish while it waits.- Releasing. On the run's page in the browser, or
branchd run release <run> <job>. Who may release is set by the branch's rules: on a protected branch, one of the rule's merge roles, and only a person when the rule asks for a person's approval. concurrency: {group: production}keeps two production deploys from overlapping.
if: cannot ask a person: it is decided when the run is compiled. Use
manual: for a decision made while the run is going.