1+ name : Deployment orchestrator v2
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ runner_os :
7+ description : ' Runner OS (ubuntu-latest or windows-latest)'
8+ required : true
9+ type : string
10+ azure_location :
11+ description : ' Azure Location For Deployment'
12+ required : false
13+ default : ' australiaeast'
14+ type : string
15+ resource_group_name :
16+ description : ' Resource Group Name (Optional)'
17+ required : false
18+ default : ' '
19+ type : string
20+ waf_enabled :
21+ description : ' Enable WAF'
22+ required : false
23+ default : false
24+ type : boolean
25+ exp :
26+ description : ' Enable EXP'
27+ required : false
28+ default : false
29+ type : boolean
30+ build_docker_image :
31+ description : ' Build And Push Docker Image (Optional)'
32+ required : false
33+ default : false
34+ type : boolean
35+ cleanup_resources :
36+ description : ' Cleanup Deployed Resources'
37+ required : false
38+ default : false
39+ type : boolean
40+ run_e2e_tests :
41+ description : ' Run End-to-End Tests'
42+ required : false
43+ default : ' GoldenPath-Testing'
44+ type : string
45+ azure_env_log_anlytics_workspace_id :
46+ description : ' Log Analytics Workspace ID (Optional)'
47+ required : false
48+ default : ' '
49+ type : string
50+ azure_existing_ai_project_resource_id :
51+ description : ' AI Project Resource ID (Optional)'
52+ required : false
53+ default : ' '
54+ type : string
55+ existing_webapp_url :
56+ description : ' Existing Container WebApp URL (Skips Deployment)'
57+ required : false
58+ default : ' '
59+ type : string
60+ trigger_type :
61+ description : ' Trigger type (workflow_dispatch, pull_request, schedule)'
62+ required : true
63+ type : string
64+ secrets :
65+ AZURE_CLIENT_ID :
66+ required : true
67+ AZURE_CLIENT_SECRET :
68+ required : true
69+ AZURE_TENANT_ID :
70+ required : true
71+ AZURE_SUBSCRIPTION_ID :
72+ required : true
73+ ACR_TEST_LOGIN_SERVER :
74+ required : true
75+ ACR_TEST_USERNAME :
76+ required : true
77+ ACR_TEST_PASSWORD :
78+ required : true
79+ AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID :
80+ required : false
81+ AZURE_ENV_FOUNDRY_PROJECT_ID :
82+ required : false
83+ EMAILNOTIFICATION_LOGICAPP_URL_TA :
84+ required : false
85+ outputs :
86+ CONTAINER_WEB_APPURL :
87+ description : " Container Web App URL"
88+ value : ${{ jobs.deploy.outputs.CONTAINER_WEB_APPURL }}
89+ RESOURCE_GROUP_NAME :
90+ description : " Resource Group Name"
91+ value : ${{ jobs.deploy.outputs.RESOURCE_GROUP_NAME }}
92+
93+ env :
94+ AZURE_DEV_COLLECT_TELEMETRY : ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
95+
96+ jobs :
97+ docker-build :
98+ uses : ./.github/workflows/job-docker-build.yml
99+ with :
100+ trigger_type : ${{ inputs.trigger_type }}
101+ build_docker_image : ${{ inputs.build_docker_image }}
102+ secrets :
103+ ACR_TEST_LOGIN_SERVER : ${{ secrets.ACR_TEST_LOGIN_SERVER }}
104+ ACR_TEST_USERNAME : ${{ secrets.ACR_TEST_USERNAME }}
105+ ACR_TEST_PASSWORD : ${{ secrets.ACR_TEST_PASSWORD }}
106+
107+ deploy :
108+ if : always() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)
109+ needs : docker-build
110+ uses : ./.github/workflows/job-azure-deploy.yml
111+ with :
112+ trigger_type : ${{ inputs.trigger_type }}
113+ runner_os : ${{ inputs.runner_os }}
114+ azure_location : ${{ inputs.azure_location }}
115+ resource_group_name : ${{ inputs.resource_group_name }}
116+ waf_enabled : ${{ inputs.waf_enabled }}
117+ EXP : ${{ inputs.exp }}
118+ build_docker_image : ${{ inputs.build_docker_image }}
119+ existing_webapp_url : ${{ inputs.existing_webapp_url }}
120+ azure_env_log_anlytics_workspace_id : ${{ inputs.azure_env_log_anlytics_workspace_id }}
121+ azure_existing_ai_project_resource_id : ${{ inputs.azure_existing_ai_project_resource_id }}
122+ docker_image_tag : ${{ needs.docker-build.outputs.IMAGE_TAG }}
123+ secrets :
124+ AZURE_CLIENT_ID : ${{ secrets.AZURE_CLIENT_ID }}
125+ AZURE_CLIENT_SECRET : ${{ secrets.AZURE_CLIENT_SECRET }}
126+ AZURE_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
127+ AZURE_SUBSCRIPTION_ID : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
128+ ACR_TEST_LOGIN_SERVER : ${{ secrets.ACR_TEST_LOGIN_SERVER }}
129+ AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID : ${{ secrets.azure_env_log_anlytics_workspace_id }}
130+ AZURE_ENV_FOUNDRY_PROJECT_ID : ${{ secrets.AZURE_ENV_FOUNDRY_PROJECT_ID }}
131+
132+ e2e-test :
133+ if : always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.CONTAINER_WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))
134+ needs : [docker-build, deploy]
135+ uses : ./.github/workflows/job-test-automation.yml
136+ with :
137+ KMGENERIC_URL : ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || inputs.existing_webapp_url }}
138+ KMGENERIC_URL_API : ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || inputs.existing_webapp_url }}
139+ TEST_SUITE : ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
140+ secrets : inherit
141+
142+ send-notification :
143+ if : always()
144+ needs : [docker-build, deploy, e2e-test]
145+ uses : ./.github/workflows/job-send-notifications.yml
146+ with :
147+ trigger_type : ${{ inputs.trigger_type }}
148+ waf_enabled : ${{ inputs.waf_enabled }}
149+ EXP : ${{ inputs.exp }}
150+ run_e2e_tests : ${{ inputs.run_e2e_tests }}
151+ existing_webapp_url : ${{ inputs.existing_webapp_url }}
152+ deploy_result : ${{ needs.deploy.result }}
153+ e2e_test_result : ${{ needs.e2e-test.result }}
154+ CONTAINER_WEB_APPURL : ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL }}
155+ RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
156+ QUOTA_FAILED : ${{ needs.deploy.outputs.QUOTA_FAILED }}
157+ TEST_SUCCESS : ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
158+ TEST_REPORT_URL : ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
159+ secrets :
160+ EMAILNOTIFICATION_LOGICAPP_URL_TA : ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
161+
162+ cleanup-deployment :
163+ if : always() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources == true || inputs.cleanup_resources == null)
164+ needs : [docker-build, deploy, e2e-test]
165+ uses : ./.github/workflows/job-cleanup-resources.yml
166+ with :
167+ runner_os : ${{ inputs.runner_os }}
168+ trigger_type : ${{ inputs.trigger_type }}
169+ cleanup_resources : ${{ inputs.cleanup_resources }}
170+ existing_webapp_url : ${{ inputs.existing_webapp_url }}
171+ RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
172+ AZURE_LOCATION : ${{ needs.deploy.outputs.AZURE_LOCATION }}
173+ AZURE_ENV_OPENAI_LOCATION : ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
174+ ENV_NAME : ${{ needs.deploy.outputs.ENV_NAME }}
175+ IMAGE_TAG : ${{ needs.deploy.outputs.IMAGE_TAG }}
176+ secrets :
177+ AZURE_CLIENT_ID : ${{ secrets.AZURE_CLIENT_ID }}
178+ AZURE_CLIENT_SECRET : ${{ secrets.AZURE_CLIENT_SECRET }}
179+ AZURE_TENANT_ID : ${{ secrets.AZURE_TENANT_ID }}
180+ AZURE_SUBSCRIPTION_ID : ${{ secrets.AZURE_SUBSCRIPTION_ID }}
0 commit comments