basically I have 3 git branches (dev, test, master) that I’m using.
What I want to achieve is to trigger the deployment process depending on tags that are being pushed to specific branches.
When somebody pushes the tag “bla_1.0-deploy-to-dev” to the dev branch, then this branch will get checked out / built / deployed to my dev system.
When somebody pushes the tag “bla_1.0-deploy-to-test” to the test branch, then this branch will get checked out / built / deployed to my test system.
When somebody pushes the tag “bla_1.0-deploy-to-prod” to the master branch, then this branch will get checked out / built / deployed to my prod system.
It is important to prevent a deployment triggered by committing the “bla_1.0-deploy-to-prod” tag to the dev or test branch for example.
So my question is: Is it possible to define that only tag / branch combinations trigger specified deployment jobs.
For now I have this config:
version: 2 jobs: "deploy": machine: true working_directory: ~/repo steps: - checkout - run: name: Deploy Git training project command: | echo "Deploying..." workflows: version: 2 build-and-deploy: jobs: - deploy: filters: tags: only: /.*deploy-to-development$/ branches: ignore: /.*/
Like this I was able to trigger the job on committing a specific tag only (and not by committing to a branch only).
Thanks a lot