Skip to content

Create an auto-deploy file #1

Create an auto-deploy file

Create an auto-deploy file #1

name: Trigger auto deployment for weather-backend
# When this action will be executed
on:
# Automatically trigger it when detected changes in repo
push:
branches:
[ prod ]
paths:
- '**'
- '.github/workflows/weather-backend-AutoDeployTrigger-287a52a1-a080-49bd-8314-6b968d7aa6c5.yml'
# Allow manual 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.WEATHERBACKEND_AZURE_CREDENTIALS }}
- name: Build and push container image to registry
uses: azure/container-apps-deploy-action@v2
with:
appSourcePath: ${{ github.workspace }}
registryUrl: shonx.azurecr.io
registryUsername: ${{ secrets.WEATHERBACKEND_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.WEATHERBACKEND_REGISTRY_PASSWORD }}
containerAppName: weather-backend
resourceGroup: weathertracker
imageToBuild: shonx.azurecr.io/weather-backend:${{ github.sha }}