-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,39 @@ | ||
# 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 | ||
|
||
```bash | ||
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` | ||
|
||
```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 | ||
``` | ||
## Thanks | ||
This repo is inspired by [steebchen/kubectl](https://github.com/steebchen/kubectl), thanks. |