Add deploy stage to GitLab CI for DockerHub integration

This commit is contained in:
Roger Gonzalez 2024-12-04 16:34:09 -03:00
parent ca78223d8e
commit 611d11292a
Signed by: rogs
GPG Key ID: C7ECE9C6C36EC2E6

View File

@ -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 .