Skip to content

Commit 2d554d6

Browse files
Merge pull request #363 from microsoft/main
fix: downmerge from main to dev
2 parents 80729e4 + 8a94985 commit 2d554d6

18 files changed

Lines changed: 125 additions & 359 deletions

.github/workflows/azure-dev.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
id: validation
2525
env:
2626
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
27-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
2827
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
2928
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3029
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}

.github/workflows/build-docker-images.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Build Docker and Optional Push
22
permissions:
33
contents: read
44
actions: read
5+
id-token: write
56
on:
67
push:
78
branches:
@@ -50,15 +51,11 @@ jobs:
5051
include:
5152
- app_name: cmsabackend
5253
dockerfile: docker/Backend.Dockerfile
53-
password_secret: DOCKER_PASSWORD
5454
- app_name: cmsafrontend
5555
dockerfile: docker/Frontend.Dockerfile
56-
password_secret: DOCKER_PASSWORD
5756
uses: ./.github/workflows/build-docker.yml
5857
with:
5958
registry: cmsacontainerreg.azurecr.io
60-
username: cmsacontainerreg
61-
password_secret: ${{ matrix.password_secret }}
6259
app_name: ${{ matrix.app_name }}
6360
dockerfile: ${{ matrix.dockerfile }}
6461
push: ${{ github.ref_name == 'main' || github.ref_name == 'dev' || github.ref_name == 'demo' || github.ref_name == 'hotfix' }}

.github/workflows/build-docker.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ on:
66
registry:
77
required: true
88
type: string
9-
username:
10-
required: true
11-
type: string
12-
password_secret:
13-
required: true
14-
type: string
159
app_name:
1610
required: true
1711
type: string
@@ -21,25 +15,27 @@ on:
2115
push:
2216
required: true
2317
type: boolean
24-
secrets:
25-
DOCKER_PASSWORD:
26-
required: false
2718

2819
jobs:
2920
docker-build:
3021
runs-on: ubuntu-latest
22+
environment: production
3123
steps:
3224

3325
- name: Checkout
3426
uses: actions/checkout@v6
3527

36-
- name: Docker Login
28+
- name: Login to Azure
3729
if: ${{ inputs.push }}
38-
uses: docker/login-action@v3
30+
uses: azure/login@v2
3931
with:
40-
registry: ${{ inputs.registry }}
41-
username: ${{ inputs.username }}
42-
password: ${{ secrets[inputs.password_secret] }}
32+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
33+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
34+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
35+
36+
- name: Login to ACR
37+
if: ${{ inputs.push }}
38+
run: az acr login --name ${{ inputs.registry }}
4339

4440
- name: Set up Docker Buildx
4541
uses: docker/setup-buildx-action@v3

.github/workflows/deploy-orchestrator.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Deployment orchestrator
22

3-
permissions:
4-
contents: read
5-
actions: read
6-
73
on:
84
workflow_call:
95
inputs:
Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
name: Deploy-Test-Cleanup (v2) Linux
1+
name: Deploy-Test-Cleanup (v2)
22
permissions:
33
contents: read
44
actions: read
5+
id-token: write
56
on:
67
workflow_run:
78
workflows: ["Build Docker and Optional Push"]
@@ -13,6 +14,14 @@ on:
1314
- demo
1415
workflow_dispatch:
1516
inputs:
17+
runner_os:
18+
description: 'Deployment Environment'
19+
required: false
20+
type: choice
21+
options:
22+
- 'codespace'
23+
- 'Local'
24+
default: 'codespace'
1625
azure_location:
1726
description: 'Azure Location For Deployment'
1827
required: false
@@ -85,6 +94,7 @@ jobs:
8594
runs-on: ubuntu-latest
8695
outputs:
8796
validation_passed: ${{ steps.validate.outputs.passed }}
97+
runner_os: ${{ steps.validate.outputs.runner_os }}
8898
azure_location: ${{ steps.validate.outputs.azure_location }}
8999
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
90100
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
@@ -100,6 +110,7 @@ jobs:
100110
id: validate
101111
shell: bash
102112
env:
113+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
103114
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
104115
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
105116
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
@@ -114,6 +125,20 @@ jobs:
114125
echo "🔍 Validating workflow input parameters..."
115126
VALIDATION_FAILED=false
116127
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+
117142
# Validate azure_location (Azure region format)
118143
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
119144
@@ -236,6 +261,7 @@ jobs:
236261
237262
# Output validated values
238263
echo "passed=true" >> $GITHUB_OUTPUT
264+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
239265
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
240266
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
241267
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
@@ -252,7 +278,7 @@ jobs:
252278
if: needs.validate-inputs.outputs.validation_passed == 'true'
253279
uses: ./.github/workflows/deploy-orchestrator.yml
254280
with:
255-
runner_os: ubuntu-latest
281+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
256282
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
257283
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
258284
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}

0 commit comments

Comments
 (0)