Skip to content
This repository has been archived by the owner on Apr 9, 2023. It is now read-only.

how to inject kube config? #12

Open
debianmaster opened this issue May 12, 2020 · 1 comment
Open

how to inject kube config? #12

debianmaster opened this issue May 12, 2020 · 1 comment

Comments

@debianmaster
Copy link

when using this action how to inject kubeconfig?

@riker09
Copy link

riker09 commented Jun 22, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants