From c468611fb09abeddfc1aae63ae02551fa37db5f9 Mon Sep 17 00:00:00 2001 From: Fredrik Ellis Date: Sat, 13 Jan 2024 20:53:40 +0100 Subject: [PATCH] Update main.yaml --- .github/workflows/main.yaml | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index d5096e1..def2e55 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,19 +19,13 @@ jobs: - name: Login to Azure Container Registry uses: azure/docker-login@v1 with: - login-server: acr0dev.azurecr.io + login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }} username: ${{ secrets.ACR_USERNAME }} password: ${{ secrets.ACR_PASSWORD }} - - name: Push Docker image to ACR - run: | - CURRENT_DATE=$(date +'%Y%m%d') - echo "CURRENT_DATE=$CURRENT_DATE" >> $GITHUB_ENV - IMAGE_NAME="acr0dev.azurecr.io/next-hello-world:${CURRENT_DATE}" - docker buildx create --use - docker buildx inspect - docker buildx build -t ${IMAGE_NAME} --push . - # Debug: Print the list of local Docker images - docker images - echo "Pushing image: $IMAGE_NAME" - docker push $IMAGE_NAME \ No newline at end of file + - name: Build and Push to ACR + uses: docker/build-push-action@v2 + with: + push: true + tags: ${{ secrets.REGISTRY_LOGIN_SERVER }}/next-hello-world:${{ github.sha }} + file: Dockerfile \ No newline at end of file