@@ -167,13 +167,47 @@ jobs:
167167 git push origin main
168168
169169 # ---------------------------------------------------------------------------
170- # 0c. Wait for ArgoCD to sync dev and report health
170+ # 0c. Upsert Kubernetes secrets from GitHub Secrets (idempotent)
171+ # ---------------------------------------------------------------------------
172+ sync-k8s-secrets-dev :
173+ name : " Sync K8s Secrets [dev]"
174+ runs-on : ubuntu-latest
175+ timeout-minutes : 10
176+ needs : [update-gitops-dev]
177+ environment : dev
178+ permissions :
179+ contents : read
180+ id-token : write
181+ steps :
182+ - uses : actions/checkout@v4
183+
184+ - name : Authenticate with AWS
185+ uses : ./.github/actions/aws-auth
186+ with :
187+ role-arn : ${{ secrets.AWS_ROLE_TO_ASSUME }}
188+ aws-region : ${{ secrets.AWS_REGION }}
189+
190+ - name : Update kubeconfig
191+ run : |
192+ aws eks update-kubeconfig \
193+ --name mypythonproject1-dev-eks \
194+ --region ${{ secrets.AWS_REGION }}
195+
196+ - name : Upsert DB credentials secret
197+ run : |
198+ kubectl create secret generic mypythonproject1-db-secret \
199+ --namespace mypythonproject1-dev \
200+ --from-literal=password=${{ secrets.DB_PASSWORD }} \
201+ --dry-run=client -o yaml | kubectl apply -f -
202+
203+ # ---------------------------------------------------------------------------
204+ # 0d. Wait for ArgoCD to sync dev and report health
171205 # ---------------------------------------------------------------------------
172206 argocd-sync-dev :
173207 name : " ArgoCD Sync [dev]"
174208 runs-on : ubuntu-latest
175209 timeout-minutes : 15
176- needs : [update-gitops -dev]
210+ needs : [sync-k8s-secrets -dev]
177211 environment : dev
178212 steps :
179213 - name : Poll ArgoCD application health
0 commit comments