fix: add kubectl apply to CI workflows and add production K8s manifest
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 4m19s
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:
@@ -68,8 +68,15 @@ jobs:
|
||||
- name: Deploy to Production
|
||||
run: |
|
||||
export SSHPASS="${{ secrets.SERVER_PASSWORD }}"
|
||||
|
||||
# Copy K8s manifests to server
|
||||
sshpass -e scp -o StrictHostKeyChecking=no k8s/production/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=300s
|
||||
kubectl apply -f /tmp/frontoffice-deployment.yaml &&
|
||||
kubectl rollout restart deployment/frontoffice &&
|
||||
kubectl rollout status deployment/frontoffice --timeout=300s &&
|
||||
rm -f /tmp/frontoffice-deployment.yaml
|
||||
"
|
||||
echo "✅ Deployed to Production!"
|
||||
|
||||
Reference in New Issue
Block a user