@@ -102,9 +102,25 @@ jobs:
102102 TEST_SUITE : ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
103103 secrets : inherit
104104
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+
105121 send-notification :
106122 if : " !cancelled()"
107- needs : [docker-build, deploy, e2e-test]
123+ needs : [docker-build, deploy, e2e-test, cleanup-deployment ]
108124 uses : ./.github/workflows/job-send-notification.yml
109125 with :
110126 trigger_type : ${{ inputs.trigger_type }}
@@ -119,20 +135,5 @@ jobs:
119135 QUOTA_FAILED : ${{ needs.deploy.outputs.QUOTA_FAILED }}
120136 TEST_SUCCESS : ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
121137 TEST_REPORT_URL : ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
122- secrets : inherit
123-
124- cleanup-deployment :
125- if : " !cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
126- needs : [docker-build, deploy, e2e-test]
127- uses : ./.github/workflows/job-cleanup-deployment.yml
128- with :
129- runner_os : ${{ inputs.runner_os }}
130- trigger_type : ${{ inputs.trigger_type }}
131- cleanup_resources : ${{ inputs.cleanup_resources }}
132- existing_webapp_url : ${{ inputs.existing_webapp_url }}
133- RESOURCE_GROUP_NAME : ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
134- AZURE_LOCATION : ${{ needs.deploy.outputs.AZURE_LOCATION }}
135- AZURE_ENV_OPENAI_LOCATION : ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
136- ENV_NAME : ${{ needs.deploy.outputs.ENV_NAME }}
137- IMAGE_TAG : ${{ needs.deploy.outputs.IMAGE_TAG }}
138+ cleanup_result : ${{ needs.cleanup-deployment.result }}
138139 secrets : inherit
0 commit comments