Skip to content

Commit 03c46a1

Browse files
author
johnydev-1
committed
ci workflow
1 parent 0a207f4 commit 03c46a1

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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

0 commit comments

Comments
 (0)