diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 79f31f84c46618f0f5b50cd0beba8747e7b09cc4..8f4e716343f196acef8a9348a9c371eabad23758 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +1,4 @@ image: docker:stable - -variables: - # When using dind service we need to instruct docker, to talk with the - # daemon started inside of the service. The daemon is available with - # a network connection instead of the default /var/run/docker.sock socket. - # - # The 'docker' hostname is the alias of the service container as described at - # https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#accessing-the-services - # - # Note that if you're using Kubernetes executor, the variable should be set to - # tcp://localhost:2375 because of how Kubernetes executor connects services - # to the job container - DOCKER_HOST: tcp://docker:2375/ # When using dind, it's wise to use the overlayfs driver for # improved performance. DOCKER_DRIVER: overlay2 @@ -26,3 +13,10 @@ build: stage: build script: - docker build -t django . + +deploy: + stage: deploy + script: + - docker login --user ${DOCKER_USER} --password ${DOCKER_PASSWORD} + - docker tag django ${DOCKER_USER}/django + - docker push ${DOCKER_USER}/django