-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (51 loc) · 1.49 KB
/
deploy-to-aks.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
53
54
55
56
57
58
59
60
61
62
---
name: Deploy to AKS
on:
push:
branches:
- main
# OIDC token being allowed be generated
permissions:
id-token: write
contents: read
jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Azure Login
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Setup kubectl
uses: azure/setup-kubectl@v3
with:
version: 'latest'
- name: Setup Helm
uses: azure/setup-helm@v3
with:
version: 'latest'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install tool for rendering templates
run: |
python3 -m pip install -r requirements.txt
- name: Render values.yaml
run: |
jinja2 --format=env basehub/values.yaml.j2 > basehub/values.yaml
env:
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }}
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }}
OAUTH_CALLBACK_URL: ${{ secrets.OAUTH_CALLBACK_URL }}
- name: Connect to AKS
run: az aks get-credentials --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} --name ${{ secrets.AZURE_KUBERNETES_CLUSTER }}
- name: Deploy to AKS
run: |
./deploy.sh
env:
K8S_NAMESPACE: ${{ vars.K8S_NAMESPACE }}
- name: Logout of Azure
run: az logout