4242 required : false
4343 default : ' GoldenPath-Testing'
4444 type : string
45- AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID :
46- description : ' Log Analytics Workspace ID (Optional)'
45+ AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID :
46+ description : ' Log Analytics Workspace Resource ID (Optional)'
4747 required : false
4848 default : ' '
4949 type : string
6464
6565env :
6666 AZURE_DEV_COLLECT_TELEMETRY : ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
67- permissions :
68- contents : read
69- actions : read
67+
7068jobs :
7169 docker-build :
7270 uses : ./.github/workflows/job-docker-build.yml
8886 EXP : ${{ inputs.EXP }}
8987 build_docker_image : ${{ inputs.build_docker_image }}
9088 existing_webapp_url : ${{ inputs.existing_webapp_url }}
91- AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID : ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
89+ AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID : ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
9290 AZURE_EXISTING_AI_PROJECT_RESOURCE_ID : ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
9391 docker_image_tag : ${{ needs.docker-build.outputs.IMAGE_TAG }}
9492 run_e2e_tests : ${{ inputs.run_e2e_tests }}
@@ -104,9 +102,25 @@ jobs:
104102 TEST_SUITE : ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
105103 secrets : inherit
106104
105+ cleanup-deployment :
106+ if : " !cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
107+ needs : [docker-build, deploy, e2e-test]
108+ uses : ./.github/workflows/job-cleanup-deployment.yml
109+ with :
110+ runner_os : ${{ inputs.runner_os }}
111+ trigger_type : ${{ inputs.trigger_type }}
112+ cleanup_resources : ${{ inputs.cleanup_resources }}
113+ existing_webapp_url : ${{ inputs.existing_webapp_url }}
114+ RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
115+ AZURE_LOCATION : ${{ needs.deploy.outputs.AZURE_LOCATION }}
116+ AZURE_ENV_OPENAI_LOCATION : ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
117+ ENV_NAME : ${{ needs.deploy.outputs.ENV_NAME }}
118+ IMAGE_TAG : ${{ needs.deploy.outputs.IMAGE_TAG }}
119+ secrets : inherit
120+
107121 send-notification :
108122 if : " !cancelled()"
109- needs : [docker-build, deploy, e2e-test]
123+ needs : [docker-build, deploy, e2e-test, cleanup-deployment ]
110124 uses : ./.github/workflows/job-send-notification.yml
111125 with :
112126 trigger_type : ${{ inputs.trigger_type }}
@@ -116,25 +130,10 @@ jobs:
116130 existing_webapp_url : ${{ inputs.existing_webapp_url }}
117131 deploy_result : ${{ needs.deploy.result }}
118132 e2e_test_result : ${{ needs.e2e-test.result }}
133+ cleanup_result : ${{ needs.cleanup-deployment.result }}
119134 CONTAINER_WEB_APPURL : ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL }}
120135 RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
121136 QUOTA_FAILED : ${{ needs.deploy.outputs.QUOTA_FAILED }}
122137 TEST_SUCCESS : ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
123138 TEST_REPORT_URL : ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
124139 secrets : inherit
125-
126- cleanup-deployment :
127- if : " !cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
128- needs : [docker-build, deploy, e2e-test]
129- uses : ./.github/workflows/job-cleanup-deployment.yml
130- with :
131- runner_os : ${{ inputs.runner_os }}
132- trigger_type : ${{ inputs.trigger_type }}
133- cleanup_resources : ${{ inputs.cleanup_resources }}
134- existing_webapp_url : ${{ inputs.existing_webapp_url }}
135- RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
136- AZURE_LOCATION : ${{ needs.deploy.outputs.AZURE_LOCATION }}
137- AZURE_ENV_OPENAI_LOCATION : ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
138- ENV_NAME : ${{ needs.deploy.outputs.ENV_NAME }}
139- IMAGE_TAG : ${{ needs.deploy.outputs.IMAGE_TAG }}
140- secrets : inherit
0 commit comments