-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.94 KB
/
ui-deploy-azure-aks.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
61
62
63
64
65
#
name: Deploy UI to Azure AKS
on:
push:
branches: ["release", "main"]
workflow_dispatch:
jobs:
run:
runs-on: ubuntu-latest
environment: 'production'
env:
ENV_NAME: 'production'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Set up AKS context
uses: azure/aks-set-context@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
cluster-name: ${{vars.CLUSTER_NAME}}
resource-group: ${{vars.AZURE_RESOURCE_GROUP}}
- name: Remove package-lock.json
run: rm -rf package-lock.json
- name: Install dependencies
run: npm install
- name: Make envfile
uses: SpicyPizza/[email protected]
with:
envkey_VITE_API_URL: ${{ secrets.VITE_API_URL }}
envkey_VITE_AUTH0_STATUS: ${{ secrets.VITE_AUTH0_STATUS }}
envkey_VITE_AUTH0_DOMAIN: ${{ secrets.VITE_AUTH0_DOMAIN }}
envkey_VITE_AUTH0_CLIENT_ID: ${{ secrets.VITE_AUTH0_CLIENT_ID }}
envkey_VITE_AUTH0_AUDIENCE: ${{ secrets.VITE_AUTH0_AUDIENCE }}
file_name: .env.${{ env.ENV_NAME }}
- name: Build
run: npm run build:${{ env.ENV_NAME }}
- name: Upload to blob storage
uses: azure/CLI@v1
with:
inlineScript: |
az storage blob upload-batch \
--destination ${{vars.AZURE_CONTAINER_BLOB}} \
--account-name ${{vars.AZURE_CONTAINER_ACCOUNT}} \
--source ./dist \
--destination-path ${{vars.APPLICATION_NAME}} \
--overwrite
# We have to use the replica trick since our nodes only have 1 GPU
- name: Kubernetes Deployment
run: |
kubectl -n ${{vars.KUBERNETES_NAMESPACE}} rollout restart deployment/${{vars.APPLICATION_NAME}}
#