From 4109c866fcb8ba0a01bd2ffe60a94a5f0c6eb74c Mon Sep 17 00:00:00 2001 From: Shamiul Mowla Date: Thu, 5 Sep 2024 14:14:07 -0400 Subject: [PATCH] Managed identity azure container push. --- .github/workflows/sandbox.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/sandbox.yml b/.github/workflows/sandbox.yml index 36bd901..a91c36f 100644 --- a/.github/workflows/sandbox.yml +++ b/.github/workflows/sandbox.yml @@ -71,9 +71,18 @@ jobs: echo "APP_DOMAIN=ajo.alloyio.com" >> $GITHUB_ENV echo "COMPOSE_FILE=docker/ajo.yml" >> $GITHUB_ENV echo "SERVICE_NAME=$(echo ${{ matrix.sample }} | sed 's/^ajo-//')" >> $GITHUB_ENV + - name: Add IP to ACR firewall + run: | + MY_IP=$(curl -s https://api.ipify.org) + az acr network-rule add --name ${{ env.ACR_NAME }} --ip-address $MY_IP - name: Build and push Docker image run: | az acr build --registry ${{ env.ACR_NAME }} --image ${{ matrix.sample }}:${{ github.sha }} --file ${{ env.COMPOSE_FILE }} . + - name: Remove IP from ACR firewall + if: always() + run: | + MY_IP=$(curl -s https://api.ipify.org) + az acr network-rule remove --name ${{ env.ACR_NAME }} --ip-address $MY_IP - name: Deploy to Azure Web App uses: azure/webapps-deploy@v2 with: