-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (50 loc) · 2.1 KB
/
deploy.yml
File metadata and controls
62 lines (50 loc) · 2.1 KB
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
61
62
name: Deploy to AKS
on:
workflow_run:
workflows: ["Build and Push Docker Images"]
branches: [main]
types: [completed]
workflow_dispatch:
concurrency:
group: deploy-aks
cancel-in-progress: false
jobs:
deploy:
if: github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v4
- name: Log in to Azure
uses: azure/login@v2
with:
creds: '{"clientId":"${{ secrets.ACR_CLIENT_ID }}","clientSecret":"${{ secrets.ACR_CLIENT_SECRET }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}"}'
- name: Set AKS context
run: |
az aks get-credentials \
-n DocumentStreamManagedCluster \
-g documentstream \
--overwrite-existing
- name: Apply K8s manifests
run: kubectl apply -k k8s/base/
- name: Update deployment image tags
run: |
SHA=${{ github.event.workflow_run.head_sha || github.sha }}
kubectl set image deployment/gateway \
gateway=acrdocumentstream.azurecr.io/gateway:${SHA} \
-n documentstream
kubectl set image deployment/extract-worker \
extract-worker=acrdocumentstream.azurecr.io/worker:${SHA} \
-n documentstream
kubectl set image deployment/classify-worker \
classify-worker=acrdocumentstream.azurecr.io/worker:${SHA} \
-n documentstream
kubectl set image deployment/store-worker \
store-worker=acrdocumentstream.azurecr.io/worker:${SHA} \
-n documentstream
- name: Wait for rollouts
run: |
kubectl rollout status deployment/gateway -n documentstream --timeout=120s
kubectl rollout status deployment/extract-worker -n documentstream --timeout=120s
kubectl rollout status deployment/classify-worker -n documentstream --timeout=120s
kubectl rollout status deployment/store-worker -n documentstream --timeout=120s