@@ -4,7 +4,6 @@ name: Deploy Gateway to Kubernetes
44
55on :
66 workflow_run :
7- # This MUST match the 'name:' of your build.yml file
87 workflows : ["Build, Test, and Package Gateway"]
98 types :
109 - completed
@@ -24,16 +23,15 @@ jobs:
2423 run : |
2524 echo "sha=$(echo ${{ github.event.workflow_run.head_sha }} | cut -c1-7)" >> $GITHUB_OUTPUT
2625
27- # 1. Checkout your new 'k8s-config' repository
2826 - name : Checkout K8s Config Repo
2927 uses : actions/checkout@v4
3028 with :
31- # This points to your new repo
3229 repository : ' TechTorque-2025/k8s-config'
33- # This uses the org-level secret you created
3430 token : ${{ secrets.REPO_ACCESS_TOKEN }}
35- # We'll put the code in a directory named 'config-repo'
36- path : ' config-repo'
31+ path : ' config-repo'
32+ # --- NEW LINE ---
33+ # Explicitly checkout the 'main' branch
34+ ref : ' main'
3735
3836 - name : Install kubectl
3937 uses : azure/setup-kubectl@v3
@@ -46,14 +44,19 @@ jobs:
4644 - name : Set Kubernetes context
4745 uses : azure/k8s-set-context@v4
4846 with :
49- kubeconfig : ${{ secrets.KUBE_CONFIG_DATA }} # This uses your Org-level secret
47+ kubeconfig : ${{ secrets.KUBE_CONFIG_DATA }}
5048
51- # 2. Update the image tag in the checked-out config repo
5249 - name : Update image tag in YAML
5350 run : |
5451 yq -i '.spec.template.spec.containers[0].image = "ghcr.io/techtorque-2025/api_gateway:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/gateway-deployment.yaml
5552
56- # 3. Deploy the updated file
53+ # --- NEW DEBUGGING STEP ---
54+ - name : Display file contents before apply
55+ run : |
56+ echo "--- Displaying k8s/services/gateway-deployment.yaml ---"
57+ cat config-repo/k8s/services/gateway-deployment.yaml
58+ echo "------------------------------------------------------"
59+
5760 - name : Deploy to Kubernetes
5861 run : |
5962 kubectl apply -f config-repo/k8s/services/gateway-deployment.yaml
0 commit comments