'YAML multi-step deployment

I want to be able to reuse the deployment variable on my bitbucket pipeline but this is not allowed. Is there any way to combine the steps?

pipelines:
  default:
    - step: *build
  branches:
    master:
      - step: *build
      - step:
          <<: *deploy1
          name: Deployment 1
          deployment: Production
      - step:
          <<: *deploy2
          name: Deployment 2
          deployment: Production


Solution 1:[1]

I see that bitbucket has this on the roadmap for bb pipelines. I'm currently trying to do something similar. If I find a solution or something works for me. I'll post my solution.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DeadlyChambers