Use YAML anchors: 

 [code: definitions:
 steps:
 - step: &Test-step
 name: Run tests
 script:
 - npm install
 - npm run test
 - step: &Deploy-step
 name: Deploy to staging
 deployment: staging
 script:
 - npm install
 - npm run build
 - fab deploy
pipelines:
 default:
 - step: *Test-step
 - step: *Deploy-step
 branches:
 master:
 - step: *Test-step
 - step:
 <<: *Deploy-step
 name: Deploy to production
 deployment: production
 trigger: manual ] 

 Docs: https://confluence.atlassian.com/bitbucket/yaml-anchors-960154027.html