Skip to content

Commit 8687f22

Browse files
author
Hai Chang
committed
Add action to push the image to ACR
1 parent 0d4a31e commit 8687f22

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/docker-publish.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,16 @@ jobs:
4848
context: .
4949
push: true
5050
tags: ${{ env.IMAGE_NAME }}:1.${{ github.run_number }},${{ env.IMAGE_NAME }}:latest
51+
52+
# Logs in with your Azure credentials
53+
- name: Azure login
54+
uses: azure/login@v1.4.6
55+
with:
56+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
57+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
58+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
59+
60+
# Builds and pushes an image up to your Azure Container Registry
61+
- name: Build and push image to ACR
62+
run: |
63+
az acr build -t ${{ vars.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ vars.CONTAINER_NAME }}:1.${{ github.run_number }} -t ${{ vars.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ vars.CONTAINER_NAME }}:${{ github.sha }} -t ${{ vars.AZURE_CONTAINER_REGISTRY }}.azurecr.io/${{ vars.CONTAINER_NAME }}:latest -r ${{ vars.AZURE_CONTAINER_REGISTRY }} -g ${{ vars.RESOURCE_GROUP }} .

0 commit comments

Comments
 (0)