Please be sure to check all occurrences of branch filters in your .travis.yml file. Usually, you can have a root branch and a deploy provider.
In general, Travis differentiates between builds initiated by pushing a commit or pull request and builds initiated by pushing a tag.
So what this means is, when you’re pushing a commit with a tag, this will trigger two builds with different conditions, (if you only filter your branch names, the build for the tag won’t get triggered).
This is essentially a safeguard for any other branch to avoid publishing the same files multiple times. The released tag will show under active branches in Travis, and its build will trigger.
If I correctly understand your example (kindly correct me if I am wrong), it means: build whether master branch or whether the branch (any) is tagged. Or, in my case, master branch (for a couple of minutes until auto-tagging kicks in) could be untagged.
In such cases, I do not want to build. Only when master branch is tagged. So I could try if: master AND tag IS present. But this will not work as, up to my understanding, you will never have both conditions full-filled (see this post).
I would reread @native-api’s advice, as this seems like the solution to the issue at hand, can you be a bit more clear on the use case? This could be maybe be approached 2 different ways that I can think of.
Historically in Travis, a tagged build, branch is equal to the tag name so it’s quite plausible your current condition is false.
The logic is as follows, on is a condition for deploy, not for stage, some people get this confused, so what that means is when you have a condition only for deploy: on: and not stage: if:, then obviously stage will be triggered, the virtual machine spins up, and then it figures out that deployment conditions (from on: ) are not fulfilled and the job/s finish without doing anything.
If you don’t want this job to trigger on pull_request, include that in condition, do something like:
if: type != pull_request AND tag IS present
NB: (There are 4 types - Pull request, Regular push, Cron and API.)