Fix CD kubeconfig handling

This commit is contained in:
defiQUG
2026-07-28 11:49:43 -07:00
parent c79e07739e
commit 7df2929fa8
+10 -13
View File
@@ -10,6 +10,8 @@ jobs:
name: Deploy to Staging
runs-on: ubuntu-latest
environment: staging
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
steps:
- uses: actions/checkout@v4
@@ -21,19 +23,16 @@ jobs:
- name: Configure kubectl
run: |
echo "${{ secrets.KUBECONFIG_STAGING }}" | base64 -d > kubeconfig
export KUBECONFIG=./kubeconfig
echo "${{ secrets.KUBECONFIG_STAGING }}" | base64 -d > "$KUBECONFIG"
- name: Deploy to Kubernetes
run: |
export KUBECONFIG=./kubeconfig
kubectl apply -f gitops/apps/api/
kubectl apply -f gitops/apps/frontend/
kubectl apply -f gitops/apps/portal/
- name: Wait for deployment
run: |
export KUBECONFIG=./kubeconfig
kubectl rollout status deployment/api -n sankofa
kubectl rollout status deployment/frontend -n sankofa
kubectl rollout status deployment/portal -n sankofa
@@ -44,6 +43,8 @@ jobs:
environment: production
needs: [deploy-staging]
if: github.ref == 'refs/heads/main'
env:
KUBECONFIG: ${{ github.workspace }}/kubeconfig
steps:
- uses: actions/checkout@v4
@@ -52,19 +53,16 @@ jobs:
- name: Configure kubectl
run: |
echo "${{ secrets.KUBECONFIG_PRODUCTION }}" | base64 -d > kubeconfig
export KUBECONFIG=./kubeconfig
echo "${{ secrets.KUBECONFIG_PRODUCTION }}" | base64 -d > "$KUBECONFIG"
- name: Deploy to Kubernetes
run: |
export KUBECONFIG=./kubeconfig
kubectl apply -f gitops/apps/api/
kubectl apply -f gitops/apps/frontend/
kubectl apply -f gitops/apps/portal/
- name: Wait for deployment
run: |
export KUBECONFIG=./kubeconfig
kubectl rollout status deployment/api -n sankofa
kubectl rollout status deployment/frontend -n sankofa
kubectl rollout status deployment/portal -n sankofa
@@ -73,4 +71,3 @@ jobs:
run: |
# Smoke tests would go here
echo "Running smoke tests..."