feat: add a new workflow to .circleci/config.yml triggered by pushing a new git tag
This commit is contained in:
parent
3a07577493
commit
5744a53b3a
|
@ -8,22 +8,41 @@ jobs:
|
||||||
- checkout
|
- checkout
|
||||||
- setup_remote_docker:
|
- setup_remote_docker:
|
||||||
version: 20.10.2
|
version: 20.10.2
|
||||||
# start proprietary DB using private Docker image
|
|
||||||
# with credentials stored in the UI
|
|
||||||
- run: |
|
- run: |
|
||||||
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
||||||
# build the application image
|
# build the application image
|
||||||
- run: docker build -t $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:latest .
|
- run: docker build -t $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:latest .
|
||||||
|
|
||||||
# deploy the image
|
# deploy the image
|
||||||
- run: docker push $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:latest
|
- run: docker push $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:latest
|
||||||
|
build_version:
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:14.17.3
|
||||||
|
working_directory: ~/zdamegzaminzawodowy
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup_remote_docker
|
||||||
|
- run: |
|
||||||
|
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
||||||
|
# build the application image
|
||||||
|
- run: docker build -t $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:$(echo $CIRCLE_TAG | sed -r 's/^.{1}//') .
|
||||||
|
# deploy the image
|
||||||
|
- run: docker push $DOCKER_LOGIN/zdam-egzamin-zawodowy-website:$(echo $CIRCLE_TAG | sed -r 's/^.{1}//')
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
deploy_prod:
|
deploy_latest:
|
||||||
jobs:
|
jobs:
|
||||||
- build:
|
- build_latest:
|
||||||
context: Zdam-Egzamin-Zawodowy
|
context: Zdam-Egzamin-Zawodowy
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
deploy_version:
|
||||||
|
jobs:
|
||||||
|
- build_version:
|
||||||
|
context: Zdam-Egzamin-Zawodowy
|
||||||
|
filters:
|
||||||
|
tags:
|
||||||
|
only: /^v.*/
|
||||||
|
branches:
|
||||||
|
ignore: /.*/
|
||||||
|
|
Reference in New Issue
Block a user