Hi, I have a pipeline that some stages are the same for multiple branches, like compile and tests, but when I need to deploy using the pipeline I want to specify what environment will receive the deploy, now Im doing conditions inside the script like: When branch is production, deploy to production, when branch is staging, deploy to staging.
I want to do something like this, is it possible?
pipelines:
branches:
'{staging, production}':
- step:
name: Build, Tests
caches:
- pip
script:
- build something
- test something
staging:
- step:
name: Deploy
script:
- Deploy to staging
production:
- step:
name: Deploy
script:
- Deploy to production
When I run the pipeline like this just scripts for "{staging and production}" runs.
Thanks for help.