mirror of
https://github.com/wahyd4/kubectl.git
synced 2026-08-09 05:06:58 +10:00
d8fd5c9f176c0ac3211b1b7e500f5170ad5141f0
Github Action for Kubernetes CLI
This action provides kubectl for Github Actions.
Usage
.github/workflows/push.yml
on: push
name: deploy
jobs:
deploy:
name: deploy to cluster
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: deploy to cluster
uses: steebchen/kubectl@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
with:
args: set image --record deployment/my-app container=${{ github.repository
}}:${{ github.sha }}
- name: verify deployment
uses: steebchen/kubectl@master
env:
KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }}
KUBECTL_VERSION: "1.15"
with:
args: '"rollout status deployment/my-app"'
Secrets
KUBE_CONFIG_DATA – required: A base64-encoded kubeconfig file with credentials for Kubernetes to access the cluster. You can get it by running the following command:
cat $HOME/.kube/config | base64
Environment
KUBECTL_VERSION - (optional): Used to specify the kubectl version. If not specified, this defaults to kubectl 1.13
Note: Do not use kubectl config view as this will hide the certificate-authority-data.
Languages
Dockerfile
71.4%
Shell
28.6%