@@ -130,7 +130,6 @@ jobs:
130130    uses : ./.github/workflows/docker.yml 
131131    secrets : inherit 
132132
133-   #  Terraform - runs after docker (for linear flow) when infra changes or manual dispatch
134133  terraform :
135134    name : Deploy Infrastructure 
136135    needs : [docker, detect-changes] 
@@ -167,53 +166,74 @@ jobs:
167166      ) 
168167     uses : ./.github/workflows/argocd.yml 
169168    secrets : inherit 
169+     with :
170+       cluster_name : ${{ needs.terraform.outputs.cluster_name }} 
171+       app_namespace : ${{ needs.terraform.outputs.app_namespace }} 
172+       monitoring_namespace : ${{ needs.terraform.outputs.monitoring_namespace }} 
173+       argocd_namespace : ${{ needs.terraform.outputs.argocd_namespace }} 
174+       app_name : ${{ needs.terraform.outputs.app_name }} 
175+       image_tag : ${{ github.sha }} 
170176    permissions :
171177      contents : write 
172178      packages : write 
173179      id-token : write 
174180      actions : read 
175181
176-   #  Application Deployment  - runs after ArgoCD when infra changes or manual dispatch 
177-   deployment :
178-     name : Deploy Application  
182+   #  Monitoring  - runs first  after ArgoCD
183+   monitoring :
184+     name : Deploy Monitoring Stack  
179185    needs : [argocd, detect-changes] 
180186    if : | 
181187      !cancelled() && 
182-       !inputs.skip-deployment  &&  
188+       !inputs.skip-monitoring  &&  
183189      (needs.argocd.result == 'success' || (needs.argocd.result == 'skipped' && inputs.skip-argocd)) && ( 
184190        inputs.force-all ||  
185191        (github.event_name == 'workflow_dispatch') || 
186192        needs.detect-changes.outputs.infra-changed == 'true' 
187193      ) 
188-      uses : ./.github/workflows/deploy .yml 
194+      uses : ./.github/workflows/monitoring .yml 
189195    secrets : inherit 
196+     with :
197+       cluster_name : ${{ needs.terraform.outputs.cluster_name }} 
198+       app_namespace : ${{ needs.terraform.outputs.app_namespace }} 
199+       monitoring_namespace : ${{ needs.terraform.outputs.monitoring_namespace }} 
200+       argocd_namespace : ${{ needs.terraform.outputs.argocd_namespace }} 
201+       app_name : ${{ needs.terraform.outputs.app_name }} 
202+       image_tag : ${{ github.sha }} 
190203    permissions :
191204      contents : write 
192205      packages : write 
193206      id-token : write 
194207      actions : read 
195208
196-   #  Monitoring  - runs in parallel with deployment  after ArgoCD 
197-   monitoring :
198-     name : Deploy Monitoring Stack  
199-     needs : [argocd , detect-changes] 
209+   #  Application Deployment  - runs after monitoring completes 
210+   deployment :
211+     name : Deploy Application  
212+     needs : [monitoring , detect-changes] 
200213    if : | 
201214      !cancelled() && 
202-       !inputs.skip-monitoring  &&  
203-       (needs.argocd .result == 'success' || (needs.argocd .result == 'skipped' && inputs.skip-argocd )) && ( 
215+       !inputs.skip-deployment  &&  
216+       (needs.monitoring .result == 'success' || (needs.monitoring .result == 'skipped' && inputs.skip-monitoring )) && ( 
204217        inputs.force-all ||  
205218        (github.event_name == 'workflow_dispatch') || 
206219        needs.detect-changes.outputs.infra-changed == 'true' 
207220      ) 
208-      uses : ./.github/workflows/monitoring .yml 
221+      uses : ./.github/workflows/deploy .yml 
209222    secrets : inherit 
223+     with :
224+       cluster_name : ${{ needs.terraform.outputs.cluster_name }} 
225+       app_namespace : ${{ needs.terraform.outputs.app_namespace }} 
226+       monitoring_namespace : ${{ needs.terraform.outputs.monitoring_namespace }} 
227+       argocd_namespace : ${{ needs.terraform.outputs.argocd_namespace }} 
228+       app_name : ${{ needs.terraform.outputs.app_name }} 
229+       image_tag : ${{ github.sha }} 
210230    permissions :
211231      contents : write 
212232      packages : write 
213233      id-token : write 
214234      actions : read 
215235
216-   #  Show endpoints - runs after both  deployment and monitoring complete 
236+   #  Show endpoints - runs after deployment completes 
217237  show-endpoints :
218238    name : Show Service Endpoints 
219239    needs : [detect-changes, deployment, monitoring] 
@@ -227,6 +247,13 @@ jobs:
227247      ) 
228248     uses : ./.github/workflows/endpoints.yml 
229249    secrets : inherit 
250+     with :
251+       cluster_name : ${{ needs.terraform.outputs.cluster_name }} 
252+       app_namespace : ${{ needs.terraform.outputs.app_namespace }} 
253+       monitoring_namespace : ${{ needs.terraform.outputs.monitoring_namespace }} 
254+       argocd_namespace : ${{ needs.terraform.outputs.argocd_namespace }} 
255+       app_name : ${{ needs.terraform.outputs.app_name }} 
256+       image_tag : ${{ github.sha }} 
230257    permissions :
231258      contents : read 
232259      id-token : write 
0 commit comments