kube-tools
kube-tools copied to clipboard
how to inject kube config?
when using this action how to inject kubeconfig?
I solved this by echoing the content of my ${{ secret.KUBECONFIG }} into the standard path of the Kubernetes config file, $HOME/.kube/config like this:
name: Deploy
on:
deployment:
env:
KUBECONFIG: .kube/config
KUBECONFIG_FILE: ${{ secrets.KUBECONFIG }}
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
mkdir -p .kube
echo "${{ env.KUBECONFIG_FILE }}" > $KUBECONFIG
- uses: stefanprodan/kube-tools@v1
with:
helmv3: 3.2.1
command: |
kubectl create namespace --ignore ${{ github.event.deployment.payload.namespace }} || true