-
Notifications
You must be signed in to change notification settings - Fork 17
45 lines (38 loc) · 1.25 KB
/
main.yaml
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
name: Deploy a .NET 6 app to Azure Kubernetes Service (AKS)
on:
push:
branches:
- 'main'
jobs:
deploy:
runs-on: ubuntu-20.04
environment: production
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
- name: Login to Azure Container Registry
uses: docker/login-action@v1
with:
registry: demostyava.azurecr.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
push: true
tags: demostyava.azurecr.io/dotnet-core-web-api:${{ github.sha }}
- name: Set AKS Context
uses: azure/aks-set-context@v1
with:
creds: '${{ secrets.AZURE_CREDENTIALS }}'
cluster-name: ${{ secrets.CLUSTER_NAME }}
resource-group: ${{ secrets.CLUSTER_RESOURCE_GROUP }}
- name: Apply Kubernetes Manifests
uses: azure/k8s-deploy@v1
with:
manifests: |
./manifests/config.yaml
./manifests/deployment.yaml
./manifests/service.yaml
images: |
demostyava.azurecr.io/dotnet-core-web-api:${{ github.sha }}