-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.66 KB
/
handlenett-api.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
50
51
52
name: Build and Deploy to Azure Container App
on:
push:
branches:
- main
paths:
- 'handlenett-backend/web-api/HandlenettAPI/**'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Azure Container Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.AZURE_ACR_REGISTRY_URL }}
username: ${{ secrets.AZURE_ACR_USERNAME }}
password: ${{ secrets.AZURE_ACR_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: handlenett-backend/web-api/HandlenettAPI
push: true
tags: |
${{ secrets.AZURE_ACR_REGISTRY_URL }}/handlenett-api:latest
${{ secrets.AZURE_ACR_REGISTRY_URL }}/handlenett-api:${{ github.sha }}
- name: Log in to Azure - App Registration Credentials
uses: azure/login@v1
with:
creds: |
{
"clientId": "${{ secrets.AZURE_CLIENT_ID_BACKEND_WEB_API }}",
"clientSecret": "${{ secrets.AZURE_SECRET_ID_BACKEND_WEB_API }}",
"subscriptionId": "${{ secrets.AZURE_SUBSCRIPTION_ID }}",
"tenantId": "${{ secrets.AZURE_TENANT_ID }}"
}
- name: Update Azure Container App with new image
run: |
az containerapp update --name handlenett-api --resource-group handlenett-rg \
--image ${{ secrets.AZURE_ACR_REGISTRY_URL }}/handlenett-api:${{ github.sha }} \
--container-name handlenett-api