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 sttm-web-container
# When this action will be executed
on:
# Automatically trigger it when detected changes in repo
push:
branches:
[ master ]
paths:
- '**'
- '.github/workflows/sttm-web-container-AutoDeployTrigger-fe063408-abd2-49aa-a2a4-d66a6e18443b.yml'
# Allow manual trigger
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
id-token: write #This is required for requesting the OIDC JWT Token
contents: read #Required when GH token is used to authenticate with private repo
steps:
- name: Checkout to the branch
uses: actions/checkout@v2
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.STTMWEBCONTAINER_AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.STTMWEBCONTAINER_AZURE_TENANT_ID }}
subscription-id: ${{ secrets.STTMWEBCONTAINER_AZURE_SUBSCRIPTION_ID }}
- name: Build and push container image to registry
uses: azure/container-apps-deploy-action@v2
with:
appSourcePath: ${{ github.workspace }}
_dockerfilePathKey_: _dockerfilePath_
registryUrl: khalis.azurecr.io
registryUsername: ${{ secrets.STTMWEBCONTAINER_REGISTRY_USERNAME }}
registryPassword: ${{ secrets.STTMWEBCONTAINER_REGISTRY_PASSWORD }}
containerAppName: sttm-web-container
resourceGroup: devops
imageToBuild: khalis.azurecr.io/sttm-web-container:${{ github.sha }}
_buildArgumentsKey_: |
_buildArgumentsValues_