Only do anything CI/CD with docker on the master branch

This commit is contained in:
Daniel_I_Am 2021-09-04 00:09:33 +02:00
parent aca59a2b22
commit 13ed04fc6d

View File

@ -7,6 +7,9 @@ stages:
auth-job: auth-job:
stage: auth stage: auth
image: docker:stable image: docker:stable
only:
refs:
- master
script: script:
- docker login --username "$REGISTRY_USER" --password "$REGISTRY_PASSWORD" "$REGISTRY_BASE_URL" - docker login --username "$REGISTRY_USER" --password "$REGISTRY_PASSWORD" "$REGISTRY_BASE_URL"
- cp "/root/.docker/config.json" "./build/.dockerconfigjson" - cp "/root/.docker/config.json" "./build/.dockerconfigjson"
@ -17,6 +20,9 @@ auth-job:
build-job: build-job:
stage: build stage: build
image: docker:stable image: docker:stable
only:
refs:
- master
tags: tags:
- docker - docker
script: script:
@ -25,6 +31,9 @@ build-job:
publish-job: publish-job:
stage: publish stage: publish
image: docker:stable image: docker:stable
only:
refs:
- master
needs: needs:
- auth-job - auth-job
- build-job - build-job