Skip to content

Docker repo must be all lowercase #4

Docker repo must be all lowercase

Docker repo must be all lowercase #4

name: container-image
on:
push:
branches:
- "building-and-testing-dotnet"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
# Critical for Azure (https://paulyu.dev/article/pushing-multi-arch-container-images-guide/)
id-token: write
# Critical for Azure (https://paulyu.dev/article/pushing-multi-arch-container-images-guide/)
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: "Azure Login"
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Login to Azure Container Registry
run: az acr login --name ${{ secrets.ACR_LOGIN_SERVER }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build WebApplication1 image and push to registry
uses: docker/build-push-action@v2
with:
context: .
file: WebApplication1/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.ACR_LOGIN_SERVER }}/webapplication1:${{ github.sha }}