Refactor KUBECONFIG handling in deployment workflow for consistency #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy with kubectl | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| env: | |
| KUBECONFIG: /tmp/${{ github.run_id }}/kubeconfig | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup kubectl | |
| uses: azure/setup-kubectl@v4 | |
| - name: Write kubeconfig | |
| run: | | |
| mkdir -p "$(dirname "$KUBECONFIG")" | |
| echo "${KUBECONFIG_B64}" | base64 -d > "$KUBECONFIG" | |
| env: | |
| KUBECONFIG_B64: ${{ secrets.KUBECONFIG_B64 }} | |
| - name: Sanity check | |
| run: kubectl get pod | |
| - name: Deploy | |
| run: kubectl apply -f k8s/ |