Skip to content

ci workflow #4

ci workflow #4 #4

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- main
permissions:
id-token: write
contents: read
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Log in to Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
client-secret: ${{ secrets.AZURE_CLIENT_SECRET }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Log in to ACR
run: |
az acr login --name ${{ secrets.ACR_NAME }}
- name: Build Docker image
run: |
docker build -t ${{ secrets.ACR_NAME }}.azurecr.io/todo-app-img:latest todo-app/
- name: Push Docker image to ACR
run: |
docker push ${{ secrets.ACR_NAME }}.azurecr.io/todo-app-img:latest