diff --git a/.github/workflows/build-docker-images.yaml b/.github/workflows/build-docker-images.yaml index c0ca95f..148baca 100644 --- a/.github/workflows/build-docker-images.yaml +++ b/.github/workflows/build-docker-images.yaml @@ -27,16 +27,18 @@ jobs: - name: Get the commit SHA id: get_commit_sha run: echo ::set-output name=COMMIT_SHA::$(git rev-parse --short "$GITHUB_SHA") + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and push Docker image uses: docker/build-push-action@v4.2.1 with: - path: labs/02-eCommerce_microservices/customer/ - dockerfile: labs/02-eCommerce_microservices/customer/Dockerfile - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: ${{ secrets.DOCKER_USERNAME }}/customer - tags: ${{ steps.get_commit_sha.outputs.COMMIT_SHA }}-${{ steps.get_branch.outputs.BRANCH }}, latest - build_args: | + context: labs/02-eCommerce_microservices/customer/ + file: labs/02-eCommerce_microservices/customer/Dockerfile + tags: ${{ secrets.DOCKER_USERNAME }}/customer:${{ steps.get_commit_sha.outputs.COMMIT_SHA }}-${{ steps.get_branch.outputs.BRANCH }}, latest + build-args: | TAG=${{ steps.get_commit_sha.outputs.COMMIT_SHA }}-${{ steps.get_branch.outputs.BRANCH }} add-hosts: customer-mongodb:127.0.0.1,order-postgres:127.0.0.1,kafka:127.0.0.1