It is a workflow with one job and no dependencies. My expectation is for this workflow to run only when I push to the master branch with a version tag (see tag pattern). However, this seems to run every time that I push to master. Can help me understand why?
I must add that even on removing the branch filter, that job is run for every commit to master and not only for the version tag push which is my expectation. Am I missing something?
Phew, finally got it to work. The solution leverages on the fact that multiple filters are ORed by CircleCI:
...
deploy-production:
jobs:
- docker_production_build:
filters:
# ignore any commit on any branch by default
branches:
ignore: /.*/
# only act on version tags
tags:
only: /^v[0-9]+(\.[0-9]+)*$/
...
I guess it is mostly my fault as it is mentioned in the documentation that branches are included and tags are excluded by default. However, my intuition for mixing the two filters did not match what CircleCI expected.
Hello, can you share what git commands did you run to trigger builds on tags ?
I have tried tens of different combinations without being able to trigger a single build from a git tag …
Indeed the jobs ran, I just didn’t look at the right place (the workflows were just not located at the same place as the branches workflows).
They do not directly appear on the left panel behind the project name, as branch workflows do.
To access them I clicked the project name to go to the project’s workflows at https://circleci.com/:provider/:org/workflows/:project.