6464
6565env :
6666 AZURE_DEV_COLLECT_TELEMETRY : ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
67+ permissions :
68+ contents : read
69+ actions : read
6770jobs :
6871 docker-build :
6972 uses : ./.github/workflows/job-docker-build.yml
@@ -101,9 +104,25 @@ jobs:
101104 TEST_SUITE : ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
102105 secrets : inherit
103106
107+ cleanup-deployment :
108+ if : " !cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
109+ needs : [docker-build, deploy, e2e-test]
110+ uses : ./.github/workflows/job-cleanup-deployment.yml
111+ with :
112+ runner_os : ${{ inputs.runner_os }}
113+ trigger_type : ${{ inputs.trigger_type }}
114+ cleanup_resources : ${{ inputs.cleanup_resources }}
115+ existing_webapp_url : ${{ inputs.existing_webapp_url }}
116+ RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
117+ AZURE_LOCATION : ${{ needs.deploy.outputs.AZURE_LOCATION }}
118+ AZURE_ENV_OPENAI_LOCATION : ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
119+ ENV_NAME : ${{ needs.deploy.outputs.ENV_NAME }}
120+ IMAGE_TAG : ${{ needs.deploy.outputs.IMAGE_TAG }}
121+ secrets : inherit
122+
104123 send-notification :
105124 if : " !cancelled()"
106- needs : [docker-build, deploy, e2e-test]
125+ needs : [docker-build, deploy, e2e-test, cleanup-deployment ]
107126 uses : ./.github/workflows/job-send-notification.yml
108127 with :
109128 trigger_type : ${{ inputs.trigger_type }}
@@ -113,25 +132,10 @@ jobs:
113132 existing_webapp_url : ${{ inputs.existing_webapp_url }}
114133 deploy_result : ${{ needs.deploy.result }}
115134 e2e_test_result : ${{ needs.e2e-test.result }}
135+ cleanup_result : ${{ needs.cleanup-deployment.result }}
116136 CONTAINER_WEB_APPURL : ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL }}
117137 RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
118138 QUOTA_FAILED : ${{ needs.deploy.outputs.QUOTA_FAILED }}
119139 TEST_SUCCESS : ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
120140 TEST_REPORT_URL : ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
121141 secrets : inherit
122-
123- cleanup-deployment :
124- if : " !cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
125- needs : [docker-build, deploy, e2e-test]
126- uses : ./.github/workflows/job-cleanup-deployment.yml
127- with :
128- runner_os : ${{ inputs.runner_os }}
129- trigger_type : ${{ inputs.trigger_type }}
130- cleanup_resources : ${{ inputs.cleanup_resources }}
131- existing_webapp_url : ${{ inputs.existing_webapp_url }}
132- RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
133- AZURE_LOCATION : ${{ needs.deploy.outputs.AZURE_LOCATION }}
134- AZURE_ENV_OPENAI_LOCATION : ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
135- ENV_NAME : ${{ needs.deploy.outputs.ENV_NAME }}
136- IMAGE_TAG : ${{ needs.deploy.outputs.IMAGE_TAG }}
137- secrets : inherit
0 commit comments