From 64b26f003b58ff789e4773268282bcfcfa7f7108 Mon Sep 17 00:00:00 2001 From: Silvija Tovernic Date: Thu, 19 Sep 2024 16:30:33 +0200 Subject: [PATCH] add: image tag equal to run number --- .github/workflows/docker-build-if-runner.yml | 39 +++++++++----------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/docker-build-if-runner.yml b/.github/workflows/docker-build-if-runner.yml index ce4839f3..a7d04bbd 100644 --- a/.github/workflows/docker-build-if-runner.yml +++ b/.github/workflows/docker-build-if-runner.yml @@ -21,25 +21,22 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 + - name: Log in to Azure Container Registry + uses: azure/docker-login@v1 + with: + login-server: ${{ secrets.REGISTRY }} + username: ${{ secrets.ACR_USERNAME }} + password: ${{ secrets.ACR_PASSWORD }} + + - name: Log in to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Build Docker Image - run: echo $IMAGE_TAG - - # - name: Log in to Azure Container Registry - # uses: azure/docker-login@v1 - # with: - # login-server: ${{ secrets.REGISTRY }} - # username: ${{ secrets.ACR_USERNAME }} - # password: ${{ secrets.ACR_PASSWORD }} - - # - name: Log in to Docker Hub - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_PASSWORD }} - - # - name: Build Docker Image - # run: docker build -t $REGISTRY/$IMAGE_NAME:$IMAGE_TAG $IMAGE_FOLDER - - # - name: Push Docker image - # run: | - # docker push $REGISTRY/$IMAGE_NAME:$IMAGE_TAG + run: docker build -t $REGISTRY/$IMAGE_NAME:$IMAGE_TAG $IMAGE_FOLDER + + - name: Push Docker image + run: | + docker push $REGISTRY/$IMAGE_NAME:$IMAGE_TAG