platform/.gitlab-ci.yml
2024-06-10 12:46:48 +03:00

45 lines
836 B
YAML

stages:
- build
- deploy-dev
- deploy-prod
.deploy:
before_script:
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
build:
stage: build
tags:
- dev
extends:
- .deploy
script:
- docker build -t mathwave/sprint-repo:platform .
- docker push mathwave/sprint-repo:platform
deploy-dev:
extends:
- .deploy
stage: deploy-dev
tags:
- dev
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: on_success
- if: '$CI_PIPELINE_SOURCE != "merge_request_event"'
when: manual
script:
- docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml platform
deploy-prod:
extends:
- .deploy
stage: deploy-prod
tags:
- prod
only:
- main
when: manual
script:
- docker stack deploy --with-registry-auth -c ./.deploy/deploy-prod.yaml platform