~tyil/www-fglt.nl

615d30a03682db945ae90b310ccf25e7b6af21eb — Patrick Spek 3 years ago 7cd9828
Push to both quay.io and registry.gitlab.com in gitlab ci
1 files changed, 14 insertions(+), 1 deletions(-)

M .gitlab-ci.yml
M .gitlab-ci.yml => .gitlab-ci.yml +14 -1
@@ 14,7 14,7 @@ Build Docker image:
    paths:
      - _site

Push Docker image:
quay.io:
  stage: push
  only:
    - master


@@ 26,3 26,16 @@ Push Docker image:
  script:
    - docker build -t $QUAY_REPOSITORY:latest $QUAY_REPOSITORY:ci-$CI_COMMIT_SHA .
    - docker push $QUAY_REPOSITORY:latest $QUAY_REPOSITORY:ci-$CI_COMMIT_SHA

registry.gitlab.com:
  stage: push
  only:
    - master
  image: docker:stable
  services:
    - docker:dind
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  script:
    - docker build -t $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:ci-$CI_COMMIT_SHA .
    - docker push $CI_REGISTRY_IMAGE:latest $CI_REGISTRY_IMAGE:ci-$CI_COMMIT_SHA