Skip to content

Commit 9ebb470

Browse files
Update deploy.yaml
1 parent d94be1c commit 9ebb470

1 file changed

Lines changed: 25 additions & 20 deletions

File tree

.github/workflows/deploy.yaml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,35 @@ on:
1010
required: false
1111
type: string
1212
default: ubuntu-latest
13-
targets:
13+
target:
1414
description: >
15-
JSON array of compact deployment targets.
16-
Each item must start with the environment name (e.g., `dev`, `uat`, `prod`)
17-
and may include a cluster suffix if that environment has multiple clusters.
18-
19-
Examples:
20-
- "dev" → deploys to the single `dev` cluster
21-
- "qa" → deploys to the single `qa` cluster
22-
- "prod" → deploys to the single `prod` cluster
23-
- "prodweu" → deploys to the `prod` environment, cluster matching "weu"
15+
The environment to deploy to (e.g., `dev`, `qa`, `prod`).
16+
17+
- If the environment maps to a **single cluster** in `env_map`, this is all you need.
18+
- If the environment maps to **multiple clusters**, you must also set `target_cluster`.
2419
required: true
25-
default: >
26-
["dev","qa",]
20+
default: "dev"
21+
22+
# REQUIRED when env has >1 clusters
23+
target_cluster:
24+
description: >
25+
The specific cluster to deploy to when the selected `target` environment
26+
has more than one cluster in `env_map`.
27+
28+
- For single-cluster environments (like `dev`, `qa`), leave this empty.
29+
- For multi-cluster environments (like `prod` with both `aks-prod-weu` and `aks-prod-use`),
30+
you must provide one of the valid cluster names from `env_map`.
31+
32+
Example: `aks-prod-weu`
33+
required: false
34+
default: ""
35+
2736
cd_repo:
2837
required: true
2938
type: string
30-
environment:
39+
github_environment:
3140
required: true
3241
type: string
33-
# REQUIRED when env has >1 clusters
34-
cluster:
35-
required: false
36-
type: string
37-
3842
# Mode A (single app)
3943
application:
4044
required: false
@@ -131,6 +135,7 @@ on:
131135
jobs:
132136
deploy:
133137
runs-on: ${{ inputs.runner }}
138+
environment: ${{ github_environment }}
134139
outputs:
135140
cd_path: ${{ steps.cdroot.outputs.cd_root }}
136141
steps:
@@ -193,8 +198,8 @@ jobs:
193198
env:
194199
INLINE_ENV_MAP: ${{ inputs.env_map }} # workflow input (preferred)
195200
ENV_MAP: ${{ env.ENV_MAP }} # fallback env var (e.g., injected from ConfigMap on self-hosted)
196-
ENVIRONMENT: ${{ inputs.environment }}
197-
CLUSTER_IN: ${{ inputs.cluster }}
201+
ENVIRONMENT: ${{ inputs.target }}
202+
CLUSTER_IN: ${{ inputs.target_cluster }}
198203
NAMESPACE: ${{ inputs.namespace }}
199204
with:
200205
script: |

0 commit comments

Comments
 (0)