Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
truck

GitHub Action

kubectl & helm

v0.1.2

kubectl & helm

truck

kubectl & helm

A Github action for using kubectl and helm to deploy applications to Kubernetes cluster

Installation

Copy and paste the following snippet into your .yml file.

              

- name: kubectl & helm

uses: wahyd4/[email protected]

Learn more about this action in wahyd4/kubectl-helm-action

Choose a version

kubectl-helm-action

A Github action for using kubectl and helm to deploy applications to Kubernetes cluster

How to use

Set up KUBE_CONFIG_DATA secret

Have your kubeconfig file encrypted

cat $HOME/.kube/config | base64

Store the encrypted string as a secret with name KUBE_CONFIG_DATA, by navigating to your repo -> Settings -> Secrets -> Add a new secret

Config a Github workflow

Create a workflow file .github/workflows/deploy.yaml

on: push
name: deploy
jobs:
  deploy:
    name: deploy to cluster
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: deploy to cluster
      uses: wahyd4/kubectl-helm-action@master
      env:
        KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
      with:
        args: kubectl apply -f manifest.yaml

Or you may want to deploy applications with helm

- name: deploy postgres to cluster
  uses: wahyd4/kubectl-helm-action@master
  env:
    KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
  with:
    args: |
      helm repo add bitnami https://charts.bitnami.com/bitnami
      helm upgrade --install postgres -n data bitnami/postgresql

Thanks

This repo is inspired by steebchen/kubectl, thanks.