GitHub Action
KubeCommands v1.28.4
1.28.4
Latest version
This action provides kubectl v1.28.4
and helm
for Github Actions.
In your workflow, here is an example that deploys your new image and verifies it is successful.
on: push
name: Deploy
jobs:
deploy:
name: Deploy to cluster
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to cluster
uses: Madfoat/[email protected]
with:
kube_config: ${{ secrets.kube_config }}
action: kubectl
command: set image --record deployment/<my-deploy> <my-container>=<my-image>:<new-tag>
- name: Verify deployment
uses: Madfoat/[email protected]
with:
kube_config: ${{ secrets.kube_config }}
action: kubectl
command: '"rollout status deployment/<my-deploy>"'
In your workflow, here is an example that installs a helm release.
on: push
name: Deploy
jobs:
deploy:
name: Deploy to cluster
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy to cluster
uses: Madfoat/[email protected]
with:
kube_config: ${{ secrets.kube_config }}
action: helm
command: upgrade --install -n <NameSpace> <Release> <Chart>
Make sure to base64-encode your kubeconfig file and put it in a github secret. You can get the string by running:
cat $HOME/.kube/config | base64