From ab31b22874dd2c355fdc89db00379447f7caeb2f Mon Sep 17 00:00:00 2001 From: meysamhadeli Date: Wed, 25 Jan 2023 01:39:06 +0330 Subject: [PATCH] . --- .github/workflows/build-publish-docker.yml | 33 ++++++++-------------- 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-publish-docker.yml b/.github/workflows/build-publish-docker.yml index 12c5d5a..f92cf4e 100644 --- a/.github/workflows/build-publish-docker.yml +++ b/.github/workflows/build-publish-docker.yml @@ -7,15 +7,6 @@ on: jobs: - update-semver: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: haya14busa/action-update-semver@v1 - id: version - with: - major_version_tag_only: true # (optional, default is "false") - build-and-push-docker-image: name: Build and Publish Docker image to DockerHub runs-on: ubuntu-latest @@ -24,6 +15,10 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Get Tag + id: vars + run: echo ::set-output name=tag::${git describe --abbrev=0} + - name: Login to DockerHub uses: docker/login-action@v2 with: @@ -32,19 +27,15 @@ jobs: - name: Build image run: | - tag_v=$(git describe --tags $(git rev-list --tags --max-count=1)) - tag=$(echo $tag_v | sed 's/v//') - docker build -t meysamh66/booking-microservices-flight:${tag} -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" . - docker build -t meysamh66/booking-microservices-identity:${tag} -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" . - docker build -t meysamh66/booking-microservices-passenger:${tag} -f "${{ github.workspace }}/src/Services/Passenger/Dockerfile" . - docker build -t meysamh66/booking-microservices-booking:${tag} -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" . + docker build -t meysamh66/booking-microservices-flight:${{ steps.vars.outputs.tag }} -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" . + docker build -t meysamh66/booking-microservices-identity:${{ steps.vars.outputs.tag }} -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" . + docker build -t meysamh66/booking-microservices-passenger:${{ steps.vars.outputs.tag }} -f "${{ github.workspace }}/src/Services/Passenger/Dockerfile" . + docker build -t meysamh66/booking-microservices-booking:${{ steps.vars.outputs.tag }} -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" . - name: Publish image run: | - tag_v=$(git describe --tags $(git rev-list --tags --max-count=1)) - tag=$(echo $tag_v | sed 's/v//') - docker push meysamh66/booking-microservices-flight:${tag} - docker push meysamh66/booking-microservices-identity:${tag} - docker push meysamh66/booking-microservices-passenger:${tag} - docker push meysamh66/booking-microservices-booking:${tag} + docker push meysamh66/booking-microservices-flight:${{ steps.vars.outputs.tag }} + docker push meysamh66/booking-microservices-identity:${{ steps.vars.outputs.tag }} + docker push meysamh66/booking-microservices-passenger:${{ steps.vars.outputs.tag }} + docker push meysamh66/booking-microservices-booking:${{ steps.vars.outputs.tag }}