File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push Docker Image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ jobs :
9
+ build-and-push :
10
+ runs-on : ubuntu-latest
11
+
12
+ steps :
13
+ - name : Checkout code
14
+ uses : actions/checkout@v3
15
+
16
+ - name : Log in to Azure
17
+ uses : azure/login@v1
18
+ with :
19
+ client-id : ${{ secrets.AZURE_CLIENT_ID }}
20
+ tenant-id : ${{ secrets.AZURE_TENANT_ID }}
21
+ client-secret : ${{ secrets.AZURE_CLIENT_SECRET }}
22
+
23
+ - name : Log in to ACR
24
+ run : |
25
+ az acr login --name ${{ secrets.ACR_NAME }}
26
+
27
+ - name : Build Docker image
28
+ run : |
29
+ docker build -t ${{ secrets.ACR_NAME }}.azurecr.io/todo-app-img:latest .
30
+
31
+ - name : Push Docker image to ACR
32
+ run : |
33
+ docker push ${{ secrets.ACR_NAME }}.azurecr.io/todo-app-img:latest
You can’t perform that action at this time.
0 commit comments