Skip to content
Latchkey

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: manual to 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: manual with a deployment environment for an audited release.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →