Skip to content

Commit da8a0ec

Browse files
Add existing webapp URL input to skip deployment
1 parent a757360 commit da8a0ec

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.github/workflows/deploy-Parameterized.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ on:
4343
required: false
4444
default: ''
4545
type: string
46+
existing_webapp_url:
47+
description: 'Enter existing WebApp URL (skips deployment if provided)'
48+
required: false
49+
default: ''
50+
type: string
4651
build_docker_image:
4752
description: 'Build and push new Docker image'
4853
required: false
@@ -67,6 +72,8 @@ env:
6772

6873
jobs:
6974
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
7077
runs-on: ubuntu-latest
7178
outputs:
7279
RESOURCE_GROUP_NAME: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
@@ -95,6 +102,12 @@ jobs:
95102
echo " • Run E2E Tests: ${{ env.RUN_E2E_TESTS }}"
96103
echo " • Cleanup Resources: ${{ env.CLEANUP_RESOURCES }}"
97104
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
98111
echo ""
99112
if [[ "${{ github.event_name }}" != "workflow_dispatch" ]]; then
100113
echo "ℹ️ Automatic Trigger: Using Non-WAF + Non-EXP configuration"
@@ -495,15 +508,15 @@ jobs:
495508
e2e-test:
496509
# Run e2e tests for automatic triggers or when manually enabled
497510
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]
499512
uses: ./.github/workflows/test-automation.yml
500513
with:
501-
DOCGEN_URL: ${{ needs.deploy.outputs.WEBAPP_URL }}
514+
DOCGEN_URL: ${{ github.event.inputs.existing_webapp_url || needs.deploy.outputs.WEBAPP_URL }}
502515
secrets: inherit
503516

504517
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 == ''))
507520
needs: [deploy]
508521
runs-on: ubuntu-latest
509522
env:

0 commit comments

Comments
 (0)