I have the following scipt:
stages:
- code_build
- code_test
- code_deploy
- image_build
- nomad_deploy_dev
code_build:
stage: code_build
script:
- [REDACTED]
artifacts:
when: always
paths:
- target/dependency-check-report.html
code_test:
stage: code_test
script:
- [REDACTED]
artifacts:
when: always
reports:
junit:
- target/surefire-reports/TEST-*.xml
code_deploy:
stage: code_deploy
script:
- [REDACTED]
rules:
- if: $CI_COMMIT_TAG
image_build_dev:
stage: image_build
script:
- [REDACTED]
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /dev/
nomad_deploy_dev:
stage: nomad_deploy_dev
environment: dev
when: on_success
script:
- [REDACTED]
rules:
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ /dev/
When I push a commit with a tag, it starts the pipeline that also deploys.
However, when i push with a tag, it also starts the regular pipeline that builds and tests.
How can I configure the script in such a way that it runs only the deploy pipeline when I push a tag and only builds & tests when i push without tag?