I’ve been trying to implement a workflow which contains three jobs. The first one, named “build”, builds the application, the two others are deployment jobs. Here are the requirements for those two jobs:
Job "deploy_to_development"
- Require “build” job to be completed
- Only run on the master branch
Job "deploy_to_production"
- Require “build” job to be completed
- Only run on the master branch
-
Only run on a tagged commit with format
/^v.*/
The relation between those requirements is a logical AND. One would expect the following configuration to fulfill those needs:
workflows:
version: 2
build_and_deploy:
jobs:
- build:
- deploy_to_development:
requires:
- build
filters:
branches:
only:
- master
- deploy_to_production:
requires:
- build
filters:
tags:
only: /^v.*/
branches:
only:
- master
But unfortunately, multiple filters behave like a logical OR. Is there any workaround to achieve my goal? I’ve tried unsuccessfully to hack the configuration with ignores or even negative lookahead regexes.