GitLab-CI: Add manual Docker Hub push job
Change-Id: If0859f2f6f644587d1db2bf9d0a1829eeccc7063
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 7d3485b..1ec01d3 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -83,15 +83,26 @@
allow_failure: true
when: manual
-# Deploy stage (placeholder for actual deployment)
+# Deploy stage - push Docker image to Docker Hub
deploy:
stage: deploy
- image: alpine:latest
+ image: docker:latest
+ services:
+ - docker:dind
before_script:
- - apk add --no-cache curl
+ - echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
script:
- - curl --version
- only:
- - tags
- when: manual
+ - |
+ # Load the built image from artifact
+ docker load -i "kalamar-plugin-export-$CI_COMMIT_TAG.tar.xz"
+ # Push the version-tagged image
+ docker push "$DOCKER_IMAGE_NAME:$CI_COMMIT_TAG"
+ # Tag and push the latest tag
+ docker tag "$DOCKER_IMAGE_NAME:$CI_COMMIT_TAG" "$DOCKER_IMAGE_NAME:latest"
+ docker push "$DOCKER_IMAGE_NAME:latest"
+ rules:
+ - if: '$CI_COMMIT_TAG =~ /^v/'
+ when: manual
allow_failure: false
+ dependencies:
+ - build-docker