docker: deploy only manually and on master/tags
authorPaul Spooren <mail@aparcar.org>
Sun, 5 Sep 2021 01:51:07 +0000 (15:51 -1000)
committerPetr Štetiar <ynezz@true.cz>
Wed, 3 Nov 2021 13:02:34 +0000 (14:02 +0100)
Unmerged branches shouldn't be deployed as "latest" image, only tags and
`master` branches should.

It is still possible to use containers from tested branches since they
are uploaded to the container registry using their *commit slug*.

Signed-off-by: Paul Spooren <mail@aparcar.org>
.gitlab/docker.yml

index 4c4fc8faa6906da68631d00edc36b0c3dd00974b..914043204df4cbd09bb3b5212bcf4dbb2e33336a 100644 (file)
 
 .deploy Docker image:
   extends: .docker in docker
+  only:
+    - master
+    - tags
+  when: manual
   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