File tree 2 files changed +49
-53
lines changed
2 files changed +49
-53
lines changed Original file line number Diff line number Diff line change @@ -28,58 +28,33 @@ jobs:
28
28
ROOT : ./frontend
29
29
secrets : inherit
30
30
31
- deploy_backend_dev :
32
- name : Deploy backend DEV
33
- needs : build_backend
34
- uses : ./.github/workflows/on_call_deploy.yaml
35
- with :
36
- ENVIRONMENT : dev
37
- APP_NAME : split-be-dev
38
- REPOSITORY : backend
39
- secrets :
40
- PUBLISH_PROFILE : ${{ secrets.AZURE_BACKEND_PUBLISH_PROFILE }}
41
-
42
- deploy_frontend_dev :
43
- name : Deploy frontend DEV
44
- needs : build_frontend
31
+ deploy_dev :
32
+ name : Deploy DEV
33
+ needs :
34
+ - build_backend
35
+ - build_frontend
45
36
uses : ./.github/workflows/on_call_deploy.yaml
46
37
with :
47
38
ENVIRONMENT : dev
48
- APP_NAME : split-fe-dev
49
- REPOSITORY : frontend
50
- secrets :
51
- PUBLISH_PROFILE : ${{ secrets.AZURE_FRONTEND_PUBLISH_PROFILE }}
39
+ CHART_OVERRIDE_PATH : ' ./infrastructure/values/development.yaml'
40
+ secrets : inherit
52
41
53
- deploy_backend_prod :
54
- name : Deploy backend PROD
55
- needs : deploy_backend_dev
56
- uses : ./.github/workflows/on_call_deploy.yaml
57
- with :
58
- ENVIRONMENT : prod
59
- APP_NAME : split-be
60
- REPOSITORY : backend
61
- secrets :
62
- PUBLISH_PROFILE : ${{ secrets.AZURE_BACKEND_PUBLISH_PROFILE }}
63
42
64
- deploy_frontend_prod :
65
- name : Deploy frontend PROD
66
- needs : deploy_frontend_dev
43
+ deploy_prod :
44
+ name : Deploy PROD
45
+ needs : deploy_dev
67
46
uses : ./.github/workflows/on_call_deploy.yaml
68
47
with :
69
48
ENVIRONMENT : prod
70
- APP_NAME : split-fe
71
- REPOSITORY : frontend
72
- secrets :
73
- PUBLISH_PROFILE : ${{ secrets.AZURE_FRONTEND_PUBLISH_PROFILE }}
49
+ CHART_OVERRIDE_PATH : ' ./infrastructure/values/production.yaml'
50
+ secrets : inherit
74
51
75
52
pre_release :
76
53
name : Create Pre Release
77
54
runs-on : ubuntu-latest
78
55
permissions :
79
56
contents : write
80
- needs :
81
- - deploy_backend_dev
82
- - deploy_frontend_dev
57
+ needs : deploy_dev
83
58
steps :
84
59
- name : Update release draft
85
60
uses : release-drafter/release-drafter@v6
93
68
runs-on : ubuntu-latest
94
69
permissions :
95
70
contents : write
96
- needs :
97
- - deploy_backend_prod
98
- - deploy_frontend_prod
71
+ needs : deploy_prod
99
72
steps :
100
73
- name : Update release draft
101
74
uses : release-drafter/release-drafter@v6
Original file line number Diff line number Diff line change 6
6
ENVIRONMENT :
7
7
required : true
8
8
type : string
9
- APP_NAME :
9
+ CHART_OVERRIDE_PATH :
10
10
required : true
11
11
type : string
12
- REPOSITORY :
13
- required : true
14
- type : string
15
- secrets :
16
- PUBLISH_PROFILE :
17
- required : true
18
12
19
13
env :
20
14
TAG : ${{ github.sha }}
15
+ CHART-PATH : ' ./infrastructure/split'
21
16
22
17
jobs :
23
18
deploy :
24
19
runs-on : ubuntu-latest
25
- environment : ${{ inputs.ENVIRONMENT }}
26
20
steps :
27
- - uses : azure/webapps-deploy@v3
21
+ - name : Checkout code
22
+ uses : actions/checkout@v2
23
+
24
+ - name : " check is AZURE_CREDENTIALS exists"
25
+ env :
26
+ super_secret : ${{ secrets.AZURE_CREDENTIALS }}
27
+ if : ${{ env.super_secret == '' }}
28
+ run : ' echo "echo the secret \"AZURE_CREDENTIALS\" has not been made; echo please go to \"settings \> secrets \> actions\" to create it"'
29
+
30
+ - name : Azure login
31
+ uses : azure/login@v2
28
32
with :
29
- app-name : ${{ inputs.APP_NAME }}
30
- publish-profile : ${{ secrets.PUBLISH_PROFILE }}
31
- images : split.azurecr.io/${{ inputs.REPOSITORY }}:${{ env.TAG }}
33
+ creds : ${{ secrets.AZURE_CREDENTIALS }}
34
+
35
+ # Use kubelogin to configure your kubeconfig for Azure auth
36
+ - name : Set up kubelogin for non-interactive login
37
+ uses : azure/use-kubelogin@v1
38
+ with :
39
+ kubelogin-version : ' v0.0.25'
40
+
41
+ - name : Set AKS context
42
+ uses : azure/aks-set-context@v4
43
+ with :
44
+ resource-group : ' ${{ secrets.RESOURCE_GROUP }}'
45
+ cluster-name : ' ${{ secrets.CLUSTER_NAME }}'
46
+ admin : ' false'
47
+ use-kubelogin : ' true'
48
+
49
+ - name : Install Helm
50
+
51
+
52
+ - name : Deploy
53
+ # environment: ${{ inputs.ENVIRONMENT }}
54
+ run : helm upgrade --install split ${{ env.CHART-PATH }} -f ${{ inputs.CHART_OVERRIDE_PATH }} --set global.image.tag=${{ env.TAG }} --namespace=split-${{ inputs.ENVIRONMENT }} --create-namespace --atomic
You can’t perform that action at this time.
0 commit comments