|
10 | 10 | required: false |
11 | 11 | type: string |
12 | 12 | default: ubuntu-latest |
13 | | - targets: |
| 13 | + target: |
14 | 14 | 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`. |
24 | 19 | 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 | + |
27 | 36 | cd_repo: |
28 | 37 | required: true |
29 | 38 | type: string |
30 | | - environment: |
| 39 | + github_environment: |
31 | 40 | required: true |
32 | 41 | type: string |
33 | | - # REQUIRED when env has >1 clusters |
34 | | - cluster: |
35 | | - required: false |
36 | | - type: string |
37 | | - |
38 | 42 | # Mode A (single app) |
39 | 43 | application: |
40 | 44 | required: false |
|
131 | 135 | jobs: |
132 | 136 | deploy: |
133 | 137 | runs-on: ${{ inputs.runner }} |
| 138 | + environment: ${{ github_environment }} |
134 | 139 | outputs: |
135 | 140 | cd_path: ${{ steps.cdroot.outputs.cd_root }} |
136 | 141 | steps: |
@@ -193,8 +198,8 @@ jobs: |
193 | 198 | env: |
194 | 199 | INLINE_ENV_MAP: ${{ inputs.env_map }} # workflow input (preferred) |
195 | 200 | 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 }} |
198 | 203 | NAMESPACE: ${{ inputs.namespace }} |
199 | 204 | with: |
200 | 205 | script: | |
|
0 commit comments