Skip to content

Commit 2d28688

Browse files
Added runner_os input (Deployment Environment) and Deleted deploy-windows.yml since it's no longer needed
1 parent 3e92618 commit 2d28688

2 files changed

Lines changed: 64 additions & 10 deletions

File tree

.github/workflows/deploy-linux.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy-Test-Cleanup (v2) Linux
1+
name: Deploy-Test-Cleanup (v2)
22
permissions:
33
contents: read
44
actions: read
@@ -14,6 +14,14 @@ on:
1414
- demo
1515
workflow_dispatch:
1616
inputs:
17+
runner_os:
18+
description: 'Deployment Environment'
19+
required: false
20+
type: choice
21+
options:
22+
- 'codespace'
23+
- 'Local'
24+
default: 'codespace'
1725
azure_location:
1826
description: 'Azure Location For Deployment'
1927
required: false
@@ -86,6 +94,7 @@ jobs:
8694
runs-on: ubuntu-latest
8795
outputs:
8896
validation_passed: ${{ steps.validate.outputs.passed }}
97+
runner_os: ${{ steps.validate.outputs.runner_os }}
8998
azure_location: ${{ steps.validate.outputs.azure_location }}
9099
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
91100
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
@@ -101,6 +110,7 @@ jobs:
101110
id: validate
102111
shell: bash
103112
env:
113+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
104114
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
105115
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
106116
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
@@ -115,6 +125,20 @@ jobs:
115125
echo "🔍 Validating workflow input parameters..."
116126
VALIDATION_FAILED=false
117127
128+
# Validate runner_os (Deployment Environment)
129+
RUNNER_INPUT="${INPUT_RUNNER_OS:-codespace}"
130+
if [[ "$RUNNER_INPUT" == "codespace" ]]; then
131+
RUNNER_OS="ubuntu-latest"
132+
echo "✅ runner_os: '$RUNNER_INPUT' → ubuntu-latest"
133+
elif [[ "$RUNNER_INPUT" == "Local" ]]; then
134+
RUNNER_OS="windows-latest"
135+
echo "✅ runner_os: '$RUNNER_INPUT' → windows-latest"
136+
else
137+
echo "❌ ERROR: runner_os must be 'codespace' or 'Local', got: '$RUNNER_INPUT'"
138+
VALIDATION_FAILED=true
139+
RUNNER_OS="ubuntu-latest"
140+
fi
141+
118142
# Validate azure_location (Azure region format)
119143
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
120144
@@ -237,6 +261,7 @@ jobs:
237261
238262
# Output validated values
239263
echo "passed=true" >> $GITHUB_OUTPUT
264+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
240265
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
241266
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
242267
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
@@ -253,7 +278,7 @@ jobs:
253278
if: needs.validate-inputs.outputs.validation_passed == 'true'
254279
uses: ./.github/workflows/deploy-orchestrator.yml
255280
with:
256-
runner_os: ubuntu-latest
281+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
257282
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
258283
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
259284
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
name: Deploy-Test-Cleanup (v2) Windows
1+
name: Deploy-Test-Cleanup (v2)
22
permissions:
33
contents: read
44
actions: read
55
id-token: write
66
on:
7+
workflow_run:
8+
workflows: ["Build Docker and Optional Push"]
9+
types:
10+
- completed
11+
branches:
12+
- main
13+
- dev
14+
- demo
715
workflow_dispatch:
816
inputs:
17+
runner_os:
18+
description: 'Deployment Environment'
19+
required: false
20+
type: choice
21+
options:
22+
- 'codespace'
23+
- 'Local'
24+
default: 'codespace'
925
azure_location:
1026
description: 'Azure Location For Deployment'
1127
required: false
@@ -25,7 +41,6 @@ on:
2541
required: false
2642
default: ''
2743
type: string
28-
2944
waf_enabled:
3045
description: 'Enable WAF'
3146
required: false
@@ -41,13 +56,11 @@ on:
4156
required: false
4257
default: false
4358
type: boolean
44-
4559
cleanup_resources:
4660
description: 'Cleanup Deployed Resources'
4761
required: false
4862
default: false
4963
type: boolean
50-
5164
run_e2e_tests:
5265
description: 'Run End-to-End Tests'
5366
required: false
@@ -57,7 +70,6 @@ on:
5770
- 'GoldenPath-Testing'
5871
- 'Smoke-Testing'
5972
- 'None'
60-
6173
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
6274
description: 'Log Analytics Workspace ID (Optional)'
6375
required: false
@@ -74,14 +86,15 @@ on:
7486
default: ''
7587
type: string
7688

77-
# schedule:
78-
# - cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
89+
schedule:
90+
- cron: '0 5,17 * * *' # Runs at 5:00 AM and 5:00 PM GMT
7991

8092
jobs:
8193
validate-inputs:
8294
runs-on: ubuntu-latest
8395
outputs:
8496
validation_passed: ${{ steps.validate.outputs.passed }}
97+
runner_os: ${{ steps.validate.outputs.runner_os }}
8598
azure_location: ${{ steps.validate.outputs.azure_location }}
8699
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
87100
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
@@ -97,6 +110,7 @@ jobs:
97110
id: validate
98111
shell: bash
99112
env:
113+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
100114
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
101115
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
102116
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
@@ -111,6 +125,20 @@ jobs:
111125
echo "🔍 Validating workflow input parameters..."
112126
VALIDATION_FAILED=false
113127
128+
# Validate runner_os (Deployment Environment)
129+
RUNNER_INPUT="${INPUT_RUNNER_OS:-codespace}"
130+
if [[ "$RUNNER_INPUT" == "codespace" ]]; then
131+
RUNNER_OS="ubuntu-latest"
132+
echo "✅ runner_os: '$RUNNER_INPUT' → ubuntu-latest"
133+
elif [[ "$RUNNER_INPUT" == "Local" ]]; then
134+
RUNNER_OS="windows-latest"
135+
echo "✅ runner_os: '$RUNNER_INPUT' → windows-latest"
136+
else
137+
echo "❌ ERROR: runner_os must be 'codespace' or 'Local', got: '$RUNNER_INPUT'"
138+
VALIDATION_FAILED=true
139+
RUNNER_OS="ubuntu-latest"
140+
fi
141+
114142
# Validate azure_location (Azure region format)
115143
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
116144
@@ -233,6 +261,7 @@ jobs:
233261
234262
# Output validated values
235263
echo "passed=true" >> $GITHUB_OUTPUT
264+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
236265
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
237266
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
238267
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
@@ -249,7 +278,7 @@ jobs:
249278
if: needs.validate-inputs.outputs.validation_passed == 'true'
250279
uses: ./.github/workflows/deploy-orchestrator.yml
251280
with:
252-
runner_os: windows-latest
281+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
253282
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
254283
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
255284
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}

0 commit comments

Comments
 (0)