battleship-front/.gitlab-ci.yml
Administrator f2865a8ab8 deploy
2022-08-22 15:12:42 +03:00

43 lines
806 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:battleship-front .
- docker push mathwave/sprint-repo:battleship-front
.deploy:
before_script:
- docker login -u mathwave -p $DOCKERHUB_PASSWORD
deploy-dev:
extends:
- .deploy
stage: deploy-dev
tags:
- dev
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- when: manual
script:
- docker stack deploy -c ./.deploy/deploy-dev.yaml battleship
deploy-prod:
extends:
- .deploy
stage: deploy-prod
tags:
- prod
only:
- master
when: manual
script:
- docker stack deploy -c ./.deploy/deploy-prod.yaml battleship