CI: add docker upload job
Change-Id: Ic1e079b04b4eebf6c67fb25074c57fd6f45be83b
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 065acda..afc38a6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -123,10 +123,7 @@
- apk update
- apk add --no-cache git
script:
- - ESCAPED_PWD=$(echo $CI_PROJECT_DIR | sed 's/\//\\\//g')
- - echo $ESCAPED_PWD
- sed -i -e "s/RUN rm -rf example-models//" Dockerfile
- - cat Dockerfile
- docker build -f Dockerfile -t idscorpuslinguistics/derekovecs:$VID-large .
- wget https://github.com/slimtoolkit/slim/releases/latest/download/dist_linux.tar.gz
- tar zxf dist_linux.tar.gz
@@ -137,3 +134,23 @@
artifacts:
paths:
- derekovecs.tar.xz
+
+upload-docker:
+ only:
+ - master
+ - tags
+ variables:
+ VID: $CI_COMMIT_TAG
+ stage: deploy
+ image: docker:latest
+ services:
+ - docker:dind
+ script:
+ - env
+ - unxz -c derekovecs.tar.xz | docker load
+ - echo "$DOCKER_HUB_PASSWORD" | docker login -u "$DOCKER_HUB_USERNAME" --password-stdin
+ - docker push idscorpuslinguistics/derekovecs:$VID
+ dependencies:
+ - build-docker
+ environment:
+ name: production