How to Deploy With a Manual Trigger Step in Bitbucket Pipelines
Set trigger: manual on the deploy step so it stays paused until someone clicks Run in the Pipelines UI.
By default steps run in sequence. Adding trigger: manual to a step makes the pipeline stop before it and wait for an operator, which is the simplest way to keep build automatic but deploy on demand.
Steps
- Keep the build/test step automatic.
- Add
trigger: manualto the deploy step. - Pass build output forward with
artifacts. - The pipeline pauses; click Run on the deploy step to release.
Pipeline
bitbucket-pipelines.yml
pipelines:
branches:
main:
- step:
name: Build
script:
- npm ci && npm run build
artifacts:
- dist/**
- step:
name: Deploy
trigger: manual
deployment: production
script:
- ./deploy.sh dist/Gotchas
- The first step in a pipeline cannot be manual; only later steps can pause.
- A manual step left unclicked does not fail; it simply stays pending.
- Combine
trigger: manualwith adeploymentenvironment for an audited release.
Related guides
How to Deploy Through Test, Staging, and Production Environments in Bitbucket PipelinesPromote a build through test, staging, and production in Bitbucket Pipelines using the deployment key on each…
How to Deploy on the main Branch Only in Bitbucket PipelinesRestrict deploys to the main branch in Bitbucket Pipelines by placing the deploy step under branches: main, s…