|
43 | 43 | required: false |
44 | 44 | default: '' |
45 | 45 | type: string |
| 46 | + existing_webapp_url: |
| 47 | + description: 'Enter existing WebApp URL (skips deployment if provided)' |
| 48 | + required: false |
| 49 | + default: '' |
| 50 | + type: string |
46 | 51 | build_docker_image: |
47 | 52 | description: 'Build and push new Docker image' |
48 | 53 | required: false |
|
67 | 72 |
|
68 | 73 | jobs: |
69 | 74 | deploy: |
| 75 | + # Skip deployment if an existing webapp URL is provided |
| 76 | + if: github.event_name != 'workflow_dispatch' || github.event.inputs.existing_webapp_url == '' || github.event.inputs.existing_webapp_url == null |
70 | 77 | runs-on: ubuntu-latest |
71 | 78 | outputs: |
72 | 79 | RESOURCE_GROUP_NAME: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }} |
@@ -95,6 +102,12 @@ jobs: |
95 | 102 | echo " • Run E2E Tests: ${{ env.RUN_E2E_TESTS }}" |
96 | 103 | echo " • Cleanup Resources: ${{ env.CLEANUP_RESOURCES }}" |
97 | 104 | echo " • Build Docker Image: ${{ env.BUILD_DOCKER_IMAGE }}" |
| 105 | + if [[ "${{ github.event.inputs.existing_webapp_url }}" != "" ]]; then |
| 106 | + echo " • Using Existing Webapp URL: ${{ github.event.inputs.existing_webapp_url }}" |
| 107 | + echo " • Skip Deployment: Yes" |
| 108 | + else |
| 109 | + echo " • Skip Deployment: No" |
| 110 | + fi |
98 | 111 | echo "" |
99 | 112 | if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then |
100 | 113 | echo "ℹ️ Automatic Trigger: Using Non-WAF + Non-EXP configuration" |
@@ -495,15 +508,15 @@ jobs: |
495 | 508 | e2e-test: |
496 | 509 | # Run e2e tests for automatic triggers or when manually enabled |
497 | 510 | if: github.event_name != 'workflow_dispatch' || github.event.inputs.run_e2e_tests == true || github.event.inputs.run_e2e_tests == null |
498 | | - needs: deploy |
| 511 | + needs: [deploy] |
499 | 512 | uses: ./.github/workflows/test-automation.yml |
500 | 513 | with: |
501 | | - DOCGEN_URL: ${{ needs.deploy.outputs.WEBAPP_URL }} |
| 514 | + DOCGEN_URL: ${{ github.event.inputs.existing_webapp_url || needs.deploy.outputs.WEBAPP_URL }} |
502 | 515 | secrets: inherit |
503 | 516 |
|
504 | 517 | cleanup-deployment: |
505 | | - # Cleanup for automatic triggers or when manually enabled |
506 | | - if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && (github.event_name != 'workflow_dispatch' || github.event.inputs.cleanup_resources == true || github.event.inputs.cleanup_resources == null) |
| 518 | + # Cleanup for automatic triggers or when manually enabled (skip cleanup when using existing webapp URL) |
| 519 | + if: always() && needs.deploy.result != 'skipped' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && (github.event_name != 'workflow_dispatch' || (github.event.inputs.cleanup_resources == true && github.event.inputs.existing_webapp_url == '')) |
507 | 520 | needs: [deploy] |
508 | 521 | runs-on: ubuntu-latest |
509 | 522 | env: |
|
0 commit comments