Hi Everyone, I have the below config.yml, and I can’t for the life of me work out why all the jobs continue to run despite me seemingly configuring it so that it needs me to tag a commit to run certain ones.
version: 2.1
jobs:
deploy_app1:
machine: true
steps:
- checkout
- run:
name: Deploy App1 Over SSH
command: |
ssh circleci@my_ip “~/deployApp1.sh”
deploy_app2:
machine: true
steps:
- checkout
- run:
name: Deploy App2 Over SSH
command: |
ssh circleci@my_ip “~/deployApp2.sh”
deploy_both:
machine: true
steps:
- checkout
- run:
name: Deploy Both App1 and App2 Over SSH
command: |
ssh circleci@my_ip “~/deployBoth.sh”
workflows:
version: 2
build-and-deploy:
jobs:
- deploy_app1:
filters:
branches:
only: main
tags:
only: /^deploy-app1./
- deploy_app2:
filters:
branches:
only: main
tags:
only: /^deploy-app2./
- deploy_both:
filters:
branches:
only: main
tags:
only: /^deploy-both.*/
Can someone please explain how I can configure my workflow so that I can tag a commit with “deploy-app1” to deploy just app1, “deploy-app2” to deploy app2, or “deploy-both” for it to run that job that deploys both? Could it be that the branch filter overrides the tags or something - which is why CircleCI is still running all jobs for any commit on main (I don’t have to tag anything)
thanks in advance.