From 611d11292ab7ecee3f8803713d93aabf74829752 Mon Sep 17 00:00:00 2001 From: Roger Gonzalez Date: Wed, 4 Dec 2024 16:34:09 -0300 Subject: [PATCH] Add deploy stage to GitLab CI for DockerHub integration --- .gitlab-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c22b8df..ed4413c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ image: python:latest stages: - lint - test + - deploy before_script: - pip install poetry @@ -26,3 +27,21 @@ test: coverage_report: coverage_format: cobertura path: coverage.xml + +deploy_to_dockerhub: + stage: deploy + needs: + - test + only: + refs: + - master + except: + - tags + image: docker:latest + services: + - docker:dind + before_script: + - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + - docker buildx create --use + script: + - docker buildx build --push --tag rogsme/cleanmedia:latest .