|
| 1 | +name: Deployment orchestrator |
| 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 | + resource_group_name: |
| 11 | + description: 'Resource Group Name (Optional)' |
| 12 | + required: false |
| 13 | + default: '' |
| 14 | + type: string |
| 15 | + waf_enabled: |
| 16 | + description: 'Enable WAF' |
| 17 | + required: false |
| 18 | + default: false |
| 19 | + type: boolean |
| 20 | + EXP: |
| 21 | + description: 'Enable EXP' |
| 22 | + required: false |
| 23 | + default: false |
| 24 | + type: boolean |
| 25 | + cleanup_resources: |
| 26 | + description: 'Cleanup Deployed Resources' |
| 27 | + required: false |
| 28 | + default: false |
| 29 | + type: boolean |
| 30 | + run_e2e_tests: |
| 31 | + description: 'Run End-to-End Tests' |
| 32 | + required: false |
| 33 | + default: 'GoldenPath-Testing' |
| 34 | + type: string |
| 35 | + existing_webapp_url: |
| 36 | + description: 'Existing Container WebApp URL (Skips Deployment)' |
| 37 | + required: false |
| 38 | + default: '' |
| 39 | + type: string |
| 40 | + existing_admin_app_url: |
| 41 | + description: 'Existing Admin WebApp URL (Skips Deployment)' |
| 42 | + required: false |
| 43 | + default: '' |
| 44 | + type: string |
| 45 | + trigger_type: |
| 46 | + description: 'Trigger type (workflow_dispatch, pull_request, schedule)' |
| 47 | + required: true |
| 48 | + type: string |
| 49 | + AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: |
| 50 | + description: 'Log Analytics Workspace ID (Optional)' |
| 51 | + required: false |
| 52 | + default: '' |
| 53 | + type: string |
| 54 | + AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION: |
| 55 | + description: 'Enable Azure Search Integrated Vectorization' |
| 56 | + required: false |
| 57 | + default: 'false' |
| 58 | + type: string |
| 59 | + AZURE_SEARCH_USE_SEMANTIC_SEARCH: |
| 60 | + description: 'Enable Azure Search Semantic Search' |
| 61 | + required: false |
| 62 | + default: 'false' |
| 63 | + type: string |
| 64 | + DATABASE_TYPE: |
| 65 | + description: 'Type of database to use' |
| 66 | + required: false |
| 67 | + default: 'PostgreSQL' |
| 68 | + type: string |
| 69 | + |
| 70 | +env: |
| 71 | + AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }} |
| 72 | + |
| 73 | +jobs: |
| 74 | + deploy: |
| 75 | + if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)" |
| 76 | + uses: ./.github/workflows/job-deploy.yml |
| 77 | + with: |
| 78 | + trigger_type: ${{ inputs.trigger_type }} |
| 79 | + runner_os: ${{ inputs.runner_os }} |
| 80 | + resource_group_name: ${{ inputs.resource_group_name }} |
| 81 | + waf_enabled: ${{ inputs.waf_enabled }} |
| 82 | + EXP: ${{ inputs.EXP }} |
| 83 | + existing_webapp_url: ${{ inputs.existing_webapp_url }} |
| 84 | + run_e2e_tests: ${{ inputs.run_e2e_tests }} |
| 85 | + AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }} |
| 86 | + cleanup_resources: ${{ inputs.cleanup_resources }} |
| 87 | + AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION: ${{ inputs.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION }} |
| 88 | + AZURE_SEARCH_USE_SEMANTIC_SEARCH: ${{ inputs.AZURE_SEARCH_USE_SEMANTIC_SEARCH }} |
| 89 | + DATABASE_TYPE: ${{ inputs.DATABASE_TYPE }} |
| 90 | + secrets: inherit |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + e2e-test: |
| 95 | + if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '' && needs.deploy.outputs.ADMIN_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null && inputs.existing_admin_app_url != '' && inputs.existing_admin_app_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))" |
| 96 | + needs: [deploy] |
| 97 | + uses: ./.github/workflows/test-automation-v2.yml |
| 98 | + with: |
| 99 | + TEST_URL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }} |
| 100 | + ADMIN_APPURL: ${{ needs.deploy.outputs.ADMIN_APPURL || inputs.existing_admin_app_url }} |
| 101 | + TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }} |
| 102 | + secrets: inherit |
| 103 | + |
| 104 | + send-notification: |
| 105 | + if: "!cancelled()" |
| 106 | + needs: [deploy, e2e-test] |
| 107 | + uses: ./.github/workflows/job-send-notification.yml |
| 108 | + with: |
| 109 | + trigger_type: ${{ inputs.trigger_type }} |
| 110 | + waf_enabled: ${{ inputs.waf_enabled }} |
| 111 | + EXP: ${{ inputs.EXP }} |
| 112 | + run_e2e_tests: ${{ inputs.run_e2e_tests }} |
| 113 | + existing_webapp_url: ${{ inputs.existing_webapp_url }} |
| 114 | + deploy_result: ${{ needs.deploy.result }} |
| 115 | + e2e_test_result: ${{ needs.e2e-test.result }} |
| 116 | + WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }} |
| 117 | + RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }} |
| 118 | + QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }} |
| 119 | + TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }} |
| 120 | + TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }} |
| 121 | + 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: [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 | + RESOURCE_TOKEN: ${{ needs.deploy.outputs.RESOURCE_TOKEN }} |
| 138 | + secrets: inherit |
0 commit comments