1- name : Deploy-Test-Cleanup Linux
1+ name : Deploy-Test-Cleanup (v2)
22on :
33 pull_request :
44 branches :
2121 - ' .github/workflows/deploy-*.yml'
2222 workflow_dispatch :
2323 inputs :
24+ runner_os :
25+ description : ' Deployment Environment'
26+ required : false
27+ type : choice
28+ options :
29+ - ' codespace'
30+ - ' Local'
31+ default : ' codespace'
32+
2433 azure_location :
2534 description : ' Azure Location For Deployment'
2635 required : false
93102 required : false
94103 default : ' '
95104 type : string
96-
97105
98106permissions :
99107 contents : read
100108 actions : read
109+ id-token : write
101110
102111jobs :
103112 validate-inputs :
@@ -115,6 +124,7 @@ jobs:
115124 azure_existing_ai_project_resource_id : ${{ steps.validate.outputs.azure_existing_ai_project_resource_id }}
116125 existing_webapp_url : ${{ steps.validate.outputs.existing_webapp_url }}
117126 azure_env_use_case : ${{ steps.validate.outputs.azure_env_use_case }}
127+ runner_os : ${{ steps.validate.outputs.runner_os }}
118128
119129 steps :
120130 - name : Validate Workflow Input Parameters
@@ -132,10 +142,25 @@ jobs:
132142 INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID : ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
133143 INPUT_EXISTING_WEBAPP_URL : ${{ github.event.inputs.existing_webapp_url }}
134144 INPUT_AZURE_ENV_USE_CASE : ${{ github.event.inputs.AZURE_ENV_USE_CASE }}
145+ INPUT_RUNNER_OS : ${{ github.event.inputs.runner_os }}
135146
136147 run : |
137148 echo "🔍 Validating workflow input parameters..."
138149 VALIDATION_FAILED=false
150+
151+ # Resolve runner_os from Deployment Environment selection
152+ DEPLOY_ENV="${INPUT_RUNNER_OS:-codespace}"
153+ if [[ "$DEPLOY_ENV" == "codespace" ]]; then
154+ RUNNER_OS="ubuntu-latest"
155+ echo "✅ Deployment Environment: 'codespace' → runner: ubuntu-latest"
156+ elif [[ "$DEPLOY_ENV" == "Local" ]]; then
157+ RUNNER_OS="windows-latest"
158+ echo "✅ Deployment Environment: 'Local' → runner: windows-latest"
159+ else
160+ echo "❌ ERROR: Deployment Environment must be 'codespace' or 'Local', got: '$DEPLOY_ENV'"
161+ VALIDATION_FAILED=true
162+ RUNNER_OS="ubuntu-latest"
163+ fi
139164
140165 # Validate azure_location (Azure region format)
141166 LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
@@ -279,14 +304,15 @@ jobs:
279304 echo "azure_existing_ai_project_resource_id=$INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID" >> $GITHUB_OUTPUT
280305 echo "existing_webapp_url=$INPUT_EXISTING_WEBAPP_URL" >> $GITHUB_OUTPUT
281306 echo "azure_env_use_case=$USE_CASE" >> $GITHUB_OUTPUT
307+ echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
282308
283309
284310 Run :
285311 needs : validate-inputs
286312 if : needs.validate-inputs.outputs.validation_passed == 'true'
287313 uses : ./.github/workflows/deploy-orchestrator.yml
288314 with :
289- runner_os : ubuntu-latest
315+ runner_os : ${{ needs.validate-inputs.outputs.runner_os || ' ubuntu-latest' }}
290316 azure_location : ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
291317 resource_group_name : ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
292318 waf_enabled : ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
@@ -299,4 +325,5 @@ jobs:
299325 existing_webapp_url : ${{ needs.validate-inputs.outputs.existing_webapp_url || '' }}
300326 azure_env_use_case : ${{ needs.validate-inputs.outputs.azure_env_use_case || 'telecom' }}
301327 trigger_type : ${{ github.event_name }}
302- secrets : inherit
328+ secrets : inherit
329+
0 commit comments