-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.3 KB
/
cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: CI/CD
on:
workflow_dispatch:
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"