From: Petr Štetiar Date: Wed, 3 Nov 2021 13:59:26 +0000 (+0100) Subject: ci: docker: deploy automatically only on default branch and tags X-Git-Tag: v1~10 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=46c1b080d3eadebbb504150788ddd2d9424eb28f;p=buildbot.git ci: docker: deploy automatically only on default branch and tags 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 --- diff --git a/.gitlab/docker.yml b/.gitlab/docker.yml index 9140432..5cc4951 100644 --- a/.gitlab/docker.yml +++ b/.gitlab/docker.yml @@ -23,10 +23,9 @@ .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