From e1d901fac15b92d3de45a863868723561df42a25 Mon Sep 17 00:00:00 2001 From: RandithaK Date: Sat, 15 Nov 2025 04:21:15 +0530 Subject: [PATCH 1/2] chore: remove obsolete deploy workflow for authentication service --- .github/workflows/deploy.yaml | 72 ----------------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/deploy.yaml diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index 920c24b..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,72 +0,0 @@ -# Authentication/.github/workflows/deploy.yml - -name: Deploy Auth Service to Kubernetes - -on: - workflow_run: - # This MUST match the 'name:' of your build.yml file - workflows: ["Build and Package Service"] - types: - - completed - branches: - - 'main' - - 'devOps' - -jobs: - deploy: - name: Deploy Auth Service to Kubernetes - # We only deploy if the build job was successful - if: ${{ github.event.workflow_run.conclusion == 'success' }} - runs-on: ubuntu-latest - - steps: - # We only need the SHA of the new image - - name: Get Commit SHA - id: get_sha - run: | - echo "sha=$(echo ${{ github.event.workflow_run.head_sha }} | cut -c1-7)" >> $GITHUB_OUTPUT - - # 1. Checkout your new 'k8s-config' repository - - name: Checkout K8s Config Repo - uses: actions/checkout@v4 - with: - # This points to your new repo - repository: 'TechTorque-2025/k8s-config' - # This uses the org-level secret you created - token: ${{ secrets.REPO_ACCESS_TOKEN }} - # We'll put the code in a directory named 'config-repo' - path: 'config-repo' - # --- NEW LINE --- - # Explicitly checkout the 'main' branch - ref: 'main' - - - name: Install kubectl - uses: azure/setup-kubectl@v3 - - - name: Install yq - run: | - sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq - sudo chmod +x /usr/bin/yq - - - name: Set Kubernetes context - uses: azure/k8s-set-context@v4 - with: - kubeconfig: ${{ secrets.KUBE_CONFIG_DATA }} # This uses your Org-level secret - - # 2. Update the image tag for the *authentication* service - - name: Update image tag in YAML - run: | - yq -i '(select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = "ghcr.io/techtorque-2025/authentication:${{ steps.get_sha.outputs.sha }}"' config-repo/k8s/services/auth-deployment.yaml - - # --- NEW DEBUGGING STEP --- - - name: Display file contents before apply - run: | - echo "--- Displaying k8s/services/auth-deployment.yaml ---" - cat config-repo/k8s/services/auth-deployment.yaml - echo "------------------------------------------------------" - - # 3. Deploy the updated file - - name: Deploy to Kubernetes - run: | - kubectl apply -f config-repo/k8s/services/auth-deployment.yaml - kubectl rollout status deployment/auth-deployment \ No newline at end of file From 52027b6592ee7c335e36130fb3cdfa618b43dfba Mon Sep 17 00:00:00 2001 From: RandithaK Date: Sat, 15 Nov 2025 04:31:21 +0530 Subject: [PATCH 2/2] fix: update image tag handling in update-manifest workflow for robustness on GH runners --- .github/workflows/update-manifest.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-manifest.yaml b/.github/workflows/update-manifest.yaml index de26549..facc339 100644 --- a/.github/workflows/update-manifest.yaml +++ b/.github/workflows/update-manifest.yaml @@ -45,17 +45,17 @@ jobs: run: | cd k8s-config NEW_IMAGE="ghcr.io/techtorque-2025/${SERVICE_NAME}:${{ steps.info.outputs.branch }}-${{ steps.info.outputs.sha }}" + export NEW_IMAGE echo "🔄 Updating ${DEPLOYMENT_FILE} to use image: ${NEW_IMAGE}" - # Use yq --arg instead of env() so we don't need to export the variable; this is robust on GH runners - yq eval -i --arg new_image "${NEW_IMAGE}" \ - '(select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = $new_image' \ + yq eval -i \ + '(select(.kind == "Deployment") | .spec.template.spec.containers[0].image) = env(NEW_IMAGE)' \ k8s/services/${DEPLOYMENT_FILE} - + echo "✅ Updated manifest:" yq eval 'select(.kind == "Deployment") | .spec.template.spec.containers[0].image' k8s/services/${DEPLOYMENT_FILE} - + - name: Commit and push changes env: SERVICE_NAME: "authentication"