fix: Ensure Knative service exists before patching in staging deployment

- Apply service manifest before attempting to patch
- This prevents 'resource not found' errors when staging service doesn't exist yet
- Ensures proper deployment flow for staging environment
This commit is contained in:
Greg
2025-06-30 23:22:30 -07:00
parent f08caeea49
commit fb69897211

View File

@@ -59,7 +59,10 @@ jobs:
kubectl apply -f - kubectl apply -f -
fi fi
# Update image in service and deploy # Apply the Knative service manifest first
kubectl apply -f manifests/staging/service.yml
# Update image in service
kubectl patch ksvc game-2048-staging -n game-2048-staging --type merge -p '{"spec":{"template":{"spec":{"containers":[{"image":"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}","imagePullPolicy":"Always"}]}}}}' kubectl patch ksvc game-2048-staging -n game-2048-staging --type merge -p '{"spec":{"template":{"spec":{"containers":[{"image":"${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}","imagePullPolicy":"Always"}]}}}}'
echo "⏳ Waiting for deployment to be ready..." echo "⏳ Waiting for deployment to be ready..."