In commit
fecd899e8189 ("docker: deploy only manually and on
master/tags") we've introduced manual deployment of the Docker images,
but this is unneeded additional manual step, so rather prefer automatic
deployment. While at it, convert to usage of `rules:` as `only:` is
deprecated and `rules:` are preferred.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
.deploy Docker image:
extends: .docker in docker
- only:
- - master
- - tags
- when: manual
+ rules:
+ - if: $CI_COMMIT_TAG
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- export IMAGE_NAME="$(echo $CI_JOB_NAME | sed 's/deploy Docker image \(.*\)/\1/')"
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY