Skip to content

Create an auto-deploy file #2

Create an auto-deploy file

Create an auto-deploy file #2

name: Trigger auto deployment for ansalemo-gh-actions-acaenv
# When this action will be executed
on:
# Automatically trigger it when detected changes in repo
push:
branches:
[ main ]
paths:
- '**'
- '.github/workflows/ansalemo-gh-actions-acaenv-AutoDeployTrigger-34a84952-ffce-4e39-a7e0-d95368a147ea.yml'
# Allow mannually trigger
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout to the branch
uses: actions/checkout@v2
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.ANSALEMOGHACTIONSACAENV_AZURE_CREDENTIALS }}
- name: Build and push container image to registry
uses: azure/container-apps-deploy-action@v1
with:
appSourcePath: ${{ github.workspace }}
registryUrl: ansalemoacr.azurecr.io
registryUsername: ${{ secrets.ANSALEMOGHACTIONSACAENV_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.ANSALEMOGHACTIONSACAENV_REGISTRY_PASSWORD }}
containerAppName: ansalemo-gh-actions-acaenv
resourceGroup: ansalemo-rg
imageToBuild: ansalemoacr.azurecr.io/ansalemo-gh-actions-acaenv:${{ github.sha }}
dockerfilePath: Dockerfile