-
Notifications
You must be signed in to change notification settings - Fork 27
60 lines (54 loc) · 1.64 KB
/
app.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build Dockerfile & Push to ACR & Deploy to AKS
on:
workflow_dispatch:
push:
paths:
- "app/**"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: ACR build
id: build-push-acr
uses: azure/acr-build@v1
with:
service_principal: ${{ secrets.SERVICE_PRINCIPAL }}
service_principal_password: ${{ secrets.SERVICE_PRINCIPAL_PASSWORD }}
tenant: ${{ secrets.TENANT }}
registry: ${{ secrets.REGISTRY }}
repository: ${{ secrets.REPOSITORY }}
image: chatbot-app
folder: app
branch: main
tag: ${{ github.sha }}
- name: Azure login
id: login
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set up kubelogin
uses: azure/use-kubelogin@v1
with:
kubelogin-version: 'v0.0.24'
- name: Set AKS context
id: set-context
uses: azure/aks-set-context@v3
with:
resource-group: '${{ secrets.RESOURCE_GROUP }}'
cluster-name: '${{ secrets.CLUSTER_NAME }}'
admin: 'false'
use-kubelogin: 'true'
- name: Setup kubectl
id: install-kubectl
uses: azure/setup-kubectl@v3
- name: Deploy to AKS
id: deploy-aks
uses: Azure/k8s-deploy@v4
with:
namespace: 'default'
manifests: |
manifest/app.yaml
images: '${{ secrets.REGISTRY }}.azurecr.io/${{ secrets.REPOSITORY }}/chatbot-app:${{ github.sha }}'
pull-images: false