Skip to content

CI/CD

CI/CD #12

Workflow file for this run

name: CI/CD
on:
workflow_dispatch:
push:
paths-ignore:
- '**.md'
jobs:
build-image:
name: Build Docker image
runs-on: ubuntu-latest
steps:
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ secrets.REGISTRY_URL }}/aca-python:latest
deploy-to-dev:
name: Deploy to Dev
runs-on: ubuntu-latest
needs: build-image
environment: dev
permissions:
id-token: write
contents: read
steps:
- name: Log into Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Deploy Container App
uses: azure/container-apps-deploy-action@v2
with:
containerAppName: python-aca
containerAppEnvironment: python-aca
resourceGroup: aca-python
imageToDeploy: ${{ secrets.REGISTRY_URL }}/aca-python:latest
environmentVariables: "APPLICATIONINSIGHTS_CONNECTION_STRING=secretref:applicationinsights-connection-string"