platform/.gitlab-ci.yml
Administrator 9e7fc7b4c1 initial
2023-09-23 16:13:11 +03:00

47 lines
958 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 build -t mathwave/sprint-repo:platform-nginx nginx
- docker push mathwave/sprint-repo:platform
- docker push mathwave/sprint-repo:platform-nginx
deploy-dev:
extends:
- .deploy
stage: deploy-dev
tags:
- dev
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
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:
- master
when: manual
script:
- docker stack deploy --with-registry-auth -c ./.deploy/deploy-prod.yaml platform