fix: add kubectl apply to CI workflows and add production K8s manifest
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m19s

Both kub-deploy and prod-deploy were only running kubectl rollout restart,
meaning changes to the deployment manifest (env vars, resources, image tag)
were never applied to the cluster.

- Add scp + kubectl apply before rollout restart in kub-deploy.yml (staging)
- Add scp + kubectl apply before rollout restart in prod-deploy.yml (production)
- Add k8s/production/frontoffice-deployment.yaml with ASPNETCORE_ENVIRONMENT=Production
  and image tag :prod

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
masoodafar-web
2026-05-14 01:44:13 +03:30
parent eef13d1471
commit 0b1cc1c1c8
3 changed files with 74 additions and 4 deletions
+9 -2
View File
@@ -67,8 +67,15 @@ jobs:
- name: Deploy to Kubernetes
run: |
export SSHPASS="${{ secrets.SERVER_PASSWORD }}"
# Copy K8s manifests to server
sshpass -e scp -o StrictHostKeyChecking=no k8s/staging/frontoffice-deployment.yaml root@${{ env.K8S_SERVER }}:/tmp/frontoffice-deployment.yaml
# Apply manifests and restart
sshpass -e ssh -o StrictHostKeyChecking=no root@${{ env.K8S_SERVER }} "
kubectl rollout restart deployment/frontoffice
kubectl rollout status deployment/frontoffice --timeout=180s
kubectl apply -f /tmp/frontoffice-deployment.yaml &&
kubectl rollout restart deployment/frontoffice &&
kubectl rollout status deployment/frontoffice --timeout=180s &&
rm -f /tmp/frontoffice-deployment.yaml
"
echo "✅ Deployed!"