roulette-bot/.gitlab-ci.yml
2024-04-22 23:21:51 +03:00

44 lines
841 B
YAML

stages:
- build
- deploy-dev
- deploy-prod
build:
stage: build
tags:
- dev
before_script:
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
script:
- docker build -t mathwave/sprint-repo:roulette-bot .
- docker push mathwave/sprint-repo:roulette-bot
.deploy:
before_script:
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
deploy-dev:
extends:
- .deploy
stage: deploy-dev
tags:
- dev
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: on_success
- when: manual
script:
- docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml roulette-bot
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 roulette-bot