Skip to content

Commit 419faf2

Browse files
Merge pull request #704 from Vamshi-Microsoft/main
ci: Added Deploy-Test-Cleanup v2 Pipeline
2 parents 1a8dca2 + 48d06b9 commit 419faf2

13 files changed

+1024
-187
lines changed
Lines changed: 69 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
1-
name: Deploy-Test-Cleanup (v2) Linux
1+
name: Deploy-Test-Cleanup (v2)
22
on:
33
pull_request:
44
branches:
55
- main
66
paths:
7-
- 'src/frontend/**'
8-
- 'src/**/*.py'
9-
- 'src/requirements*.txt'
10-
- 'src/WebApp.Dockerfile'
11-
- '!src/tests/**'
12-
- 'infra/**/*.bicep'
13-
- 'infra/**/*.json'
14-
- '*.yaml'
7+
- 'content-gen/src/**'
8+
- '!content-gen/src/tests/**'
9+
- 'content-gen/infra/**/*.bicep'
10+
- 'content-gen/infra/**/*.json'
11+
- 'content-gen/*.yaml'
12+
- 'content-gen/scripts/**'
1513
- '.github/workflows/deploy-*.yml'
1614
workflow_run:
1715
workflows: ["Build Docker and Optional Push"]
@@ -23,6 +21,16 @@ on:
2321
- demo
2422
workflow_dispatch:
2523
inputs:
24+
runner_os:
25+
description: 'Deployment Environment'
26+
required: false
27+
type: choice
28+
options:
29+
- 'codespace'
30+
- 'Devcontainer'
31+
- 'Local'
32+
default: 'codespace'
33+
2634
azure_location:
2735
description: 'Azure Location For Deployment'
2836
required: false
@@ -32,11 +40,14 @@ on:
3240
- 'australiaeast'
3341
- 'centralus'
3442
- 'eastasia'
35-
- 'eastus2'
43+
- 'eastus'
3644
- 'japaneast'
3745
- 'northeurope'
3846
- 'southeastasia'
47+
- 'swedencentral'
3948
- 'uksouth'
49+
- 'westus'
50+
- 'westus3'
4051
resource_group_name:
4152
description: 'Resource Group Name (Optional)'
4253
required: false
@@ -90,17 +101,29 @@ on:
90101
required: false
91102
default: ''
92103
type: string
104+
image_model_choice:
105+
description: 'Image Model to Deploy'
106+
required: false
107+
default: 'gpt-image-1'
108+
type: choice
109+
options:
110+
- 'gpt-image-1'
111+
- 'gpt-image-1.5'
112+
- 'dall-e-3'
113+
- 'none'
93114

94115
schedule:
95-
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
116+
- cron: '30 4 * * *' # Runs at 10:00 AM IST (4:30 AM UTC)
96117
permissions:
97118
contents: read
98119
actions: read
120+
packages: write # Required by deploy-orchestrator → job-deploy → job-deploy-devcontainer for GHCR
99121
jobs:
100122
validate-inputs:
101123
runs-on: ubuntu-latest
102124
outputs:
103125
validation_passed: ${{ steps.validate.outputs.passed }}
126+
runner_os: ${{ steps.validate.outputs.runner_os }}
104127
azure_location: ${{ steps.validate.outputs.azure_location }}
105128
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
106129
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
@@ -111,11 +134,13 @@ jobs:
111134
azure_env_log_analytics_workspace_id: ${{ steps.validate.outputs.azure_env_log_analytics_workspace_id }}
112135
azure_existing_ai_project_resource_id: ${{ steps.validate.outputs.azure_existing_ai_project_resource_id }}
113136
existing_webapp_url: ${{ steps.validate.outputs.existing_webapp_url }}
137+
image_model_choice: ${{ steps.validate.outputs.image_model_choice }}
114138
steps:
115139
- name: Validate Workflow Input Parameters
116140
id: validate
117141
shell: bash
118142
env:
143+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
119144
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
120145
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
121146
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
@@ -126,10 +151,30 @@ jobs:
126151
INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ github.event.inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
127152
INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
128153
INPUT_EXISTING_WEBAPP_URL: ${{ github.event.inputs.existing_webapp_url }}
154+
INPUT_IMAGE_MODEL_CHOICE: ${{ github.event.inputs.image_model_choice }}
129155
run: |
130156
echo "🔍 Validating workflow input parameters..."
131157
VALIDATION_FAILED=false
132158
159+
# Validate runner_os (specific allowed values) and derive actual runner
160+
RUNNER_OS_INPUT="${INPUT_RUNNER_OS:-codespace}"
161+
if [[ "$RUNNER_OS_INPUT" != "codespace" && "$RUNNER_OS_INPUT" != "Devcontainer" && "$RUNNER_OS_INPUT" != "Local" ]]; then
162+
echo "❌ ERROR: runner_os must be one of: codespace, Devcontainer, Local, got: '$RUNNER_OS_INPUT'"
163+
VALIDATION_FAILED=true
164+
else
165+
echo "✅ runner_os: '$RUNNER_OS_INPUT' is valid"
166+
fi
167+
168+
# Derive actual runner from runner_os input
169+
if [[ "$RUNNER_OS_INPUT" == "codespace" ]]; then
170+
RUNNER_OS="ubuntu-latest"
171+
elif [[ "$RUNNER_OS_INPUT" == "Devcontainer" ]]; then
172+
RUNNER_OS="devcontainer"
173+
else
174+
RUNNER_OS="windows-latest"
175+
fi
176+
echo "✅ runner_os derived as: '$RUNNER_OS'"
177+
133178
# Validate azure_location (Azure region format)
134179
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
135180
@@ -252,6 +297,7 @@ jobs:
252297
253298
# Output validated values
254299
echo "passed=true" >> $GITHUB_OUTPUT
300+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
255301
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
256302
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
257303
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
@@ -262,13 +308,23 @@ jobs:
262308
echo "azure_env_log_analytics_workspace_id=$INPUT_AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID" >> $GITHUB_OUTPUT
263309
echo "azure_existing_ai_project_resource_id=$INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID" >> $GITHUB_OUTPUT
264310
echo "existing_webapp_url=$INPUT_EXISTING_WEBAPP_URL" >> $GITHUB_OUTPUT
311+
312+
# Validate and output image_model_choice
313+
IMAGE_MODEL="${INPUT_IMAGE_MODEL_CHOICE:-gpt-image-1}"
314+
ALLOWED_MODELS=("gpt-image-1" "gpt-image-1.5" "dall-e-3" "none")
315+
if [[ ! " ${ALLOWED_MODELS[@]} " =~ " ${IMAGE_MODEL} " ]]; then
316+
echo "❌ ERROR: image_model_choice '$IMAGE_MODEL' is invalid. Allowed: ${ALLOWED_MODELS[*]}"
317+
exit 1
318+
fi
319+
echo "✅ image_model_choice: '$IMAGE_MODEL' is valid"
320+
echo "image_model_choice=$IMAGE_MODEL" >> $GITHUB_OUTPUT
265321
266322
Run:
267323
needs: validate-inputs
268324
if: needs.validate-inputs.outputs.validation_passed == 'true'
269325
uses: ./.github/workflows/deploy-orchestrator.yml
270326
with:
271-
runner_os: ubuntu-latest
327+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
272328
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
273329
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
274330
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
@@ -280,4 +336,5 @@ jobs:
280336
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ needs.validate-inputs.outputs.azure_existing_ai_project_resource_id || '' }}
281337
existing_webapp_url: ${{ needs.validate-inputs.outputs.existing_webapp_url || '' }}
282338
trigger_type: ${{ github.event_name }}
339+
image_model_choice: ${{ needs.validate-inputs.outputs.image_model_choice || 'gpt-image-1' }}
283340
secrets: inherit

.github/workflows/deploy-orchestrator.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_call:
55
inputs:
66
runner_os:
7-
description: 'Runner OS (ubuntu-latest or windows-latest)'
7+
description: 'Runner OS (ubuntu-latest, windows-latest, or devcontainer)'
88
required: true
99
type: string
1010
azure_location:
@@ -61,12 +61,18 @@ on:
6161
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
6262
required: true
6363
type: string
64+
image_model_choice:
65+
description: 'Image model to deploy (gpt-image-1, gpt-image-1.5, dall-e-3, none)'
66+
required: false
67+
default: 'gpt-image-1'
68+
type: string
6469

6570
env:
6671
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
6772
permissions:
6873
contents: read
6974
actions: read
75+
packages: write # Required by job-deploy → job-deploy-devcontainer to push devcontainer image to GHCR
7076

7177
jobs:
7278
docker-build:
@@ -94,10 +100,12 @@ jobs:
94100
docker_image_tag: ${{ needs.docker-build.outputs.IMAGE_TAG }}
95101
run_e2e_tests: ${{ inputs.run_e2e_tests }}
96102
cleanup_resources: ${{ inputs.cleanup_resources }}
103+
image_model_choice: ${{ inputs.image_model_choice }}
97104
secrets: inherit
98105

99106
e2e-test:
100-
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
107+
# if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
108+
if: false # Temporarily disable E2E tests
101109
needs: [docker-build, deploy]
102110
uses: ./.github/workflows/test-automation-v2.yml
103111
with:

.github/workflows/deploy-windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ on:
8686
permissions:
8787
contents: read
8888
actions: read
89+
packages: write # Required by deploy-orchestrator → job-deploy → job-deploy-devcontainer for GHCR
8990

9091
jobs:
9192
validate-inputs:

0 commit comments

Comments
 (0)