Allow runner default kubeconfig for deploy

This commit is contained in:
hz
2026-07-09 20:59:13 -05:00
parent 4a2c8b80f2
commit 1b559cf3fb
+9 -9
View File
@@ -53,29 +53,29 @@ jobs:
run: |
rm -f "${IMAGE_TAR}"
- name: Write kubeconfig from secret
- name: Configure kubeconfig
env:
KUBECONFIG_CONTENT: ${{ secrets.KUBECONFIG }}
run: |
mkdir -p /tmp/kube
printf '%s\n' "$KUBECONFIG_CONTENT" > /tmp/kube/config
if [ -n "$KUBECONFIG_CONTENT" ]; then
mkdir -p /tmp/kube
printf '%s\n' "$KUBECONFIG_CONTENT" > /tmp/kube/config
echo "KUBECONFIG=/tmp/kube/config" >> "$GITHUB_ENV"
echo "Using kubeconfig from KUBECONFIG secret."
else
echo "KUBECONFIG secret is not set for this repo; using runner default kubeconfig."
fi
- name: Create namespace if missing
env:
KUBECONFIG: /tmp/kube/config
run: |
kubectl create namespace step3-questions --dry-run=client -o yaml | kubectl apply -f -
- name: Apply Questions deployment & service
env:
KUBECONFIG: /tmp/kube/config
run: |
kubectl apply -f api/QuestionsApi/k8s/deployment.yaml -n step3-questions
kubectl apply -f api/QuestionsApi/k8s/service.yaml -n step3-questions
- name: Restart Questions deployment
env:
KUBECONFIG: /tmp/kube/config
run: |
kubectl rollout restart deployment/step3-questions -n step3-questions
kubectl rollout status deployment/step3-questions -n step3-questions