diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3feae9e..fcd7d56 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -87,16 +87,16 @@ test:nglint: - npm ng lint docker-build: - image: docker:latest stage: package + image: docker:latest services: - docker:dind + variables: + IMAGE_TAG: "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHORT_SHA" + before_script: + - docker login -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD $CI_REGISTRY + script: + - docker build -t $IMAGE_TAG -f Dockerfile . + - docker push $IMAGE_TAG only: - master - before_script: - - echo $CI_BUILD_TOKEN | docker login -u "$CI_REGISTRY_USER" - --password-stdin $CI_REGISTRY - script: - - IMAGE_NAME="$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" - - docker build --pull -t "$IMAGE_NAME" -f Dockerfile . - - docker push "$IMAGE_NAME"