I want to be able to have a pipeline that deploys a main branch to a test environment and then a versioned release to production.
The versioned prod env will only be have a newer versioned deployed once testing has been signed off.
I want to have a single pipeline that does this, that I can run on a schedule so that prod is always up to date with certificates etc.
I have tried to do something like the following, but this only runs the deploy:test and not the deploy:prod
deploy:test:
image: alpine:3.18
stage: release
script:
- echo "this is the $CI_DEFAULT_BRANCH"
- cat version.txt
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: always
deploy:prod:
image: alpine:3.18
stage: release
script:
- cat version.txt
rules:
- if: $CI_COMMIT_TAG == "v11.0.0"
when: always
Is something like this possible with gitlab ci?