push to acr #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Build and deploy to Web-App | |
on: | |
push: | |
branches: ["feature/acr-deployment"] | |
permissions: | |
contents: read | |
packages: write | |
env: | |
APP_NAME: wa-users-management | |
RG_NAME: rg-users-managemet | |
WORKING_DIR: users_management | |
jobs: | |
build: | |
name: Docker Build and Push to ACR | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Checkout repository | |
uses: actions/checkout@v4 | |
- name: π§ Docker QEMU Setup | |
uses: docker/setup-qemu-action@v3 | |
- name: π οΈ Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: π Docker metadata | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
flavor: | | |
latest=false | |
tags: | | |
type=raw,value=latest | |
type=semver,pattern=v{{version}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
- name: π³ Docker Build & Push | |
uses: docker/build-push-action@v5 | |
id: docker_build | |
with: | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
context: ./${{ env.WORKING_DIR }} | |
push: false | |
provenance: false | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} | |
file: ./${{ env.WORKING_DIR }}/Dockerfile | |
- name: π’ Push Docker image to Azure Container Registry | |
run: | | |
docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/${{ env.WORKING_DIR }}:${{ steps.docker_build.outputs.tags }} |