Skip to content

Commit abff7c3

Browse files
authored
Merge pull request #5 from aboutbits/setup-kubectl-and-helm
setup-kubectl-and-helm
2 parents 6173e06 + c2648bc commit abff7c3

3 files changed

Lines changed: 49 additions & 49 deletions

File tree

do-setup-kubectl/action.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

readme.md

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,27 @@ A collection of Kubernetes related GitHub actions.
44

55
## Actions
66

7-
### Setup DigitalOcean
7+
### Setup kubectl and Helm
88

9-
Setup Digital-Ocean CLI and configure Kubernetes.
9+
Setup kubectl and Helm using kubeconfig file.
1010

1111
#### Example
1212

1313
```yaml
14-
- uses: aboutbits/github-actions-kubernetes/do-setup-kubectl@v2
14+
- uses: aboutbits/github-actions-kubernetes/setup-kubectl-and-helm@v3
1515
with:
16-
digital-ocean-token: ${{ secrets.DIGITALOCEAN_TOKEN }}
17-
cluster-name: ${{ env.CLUSTER_NAME }}
16+
kubeconfig: ${{ secrets.KUBECONFIG }}
1817
```
1918
2019
#### Inputs
2120
2221
The following inputs can be used as `step.with` keys:
2322

24-
| Name | Required/Default | Description |
25-
|-----------------------|------------------|----------------------------------------|
26-
| `digital-ocean-token` | required | DigitalOcean access token |
27-
| `cluster-name` | required | Kubernetes cluster name |
28-
| `helm-version` | `3.17.1` | The version of Helm to install and use |
29-
23+
| Name | Required/Default | Description |
24+
|----------------|------------------|-----------------------------|
25+
| `kubeconfig` | required | The kubeconfig file content |
26+
| `kube-version` | `1.33.1` | The version of kubectl |
27+
| `helm-version` | `3.17.3` | The version of Helm |
3028

3129
### Deploy to Kubernetes using kubectl
3230

@@ -35,7 +33,7 @@ Deploy application to a Kubernetes Cluster. Requires Kubernetes to be configured
3533
#### Example
3634

3735
```yaml
38-
- uses: aboutbits/github-actions-kubernetes/kubectl-deploy@v2
36+
- uses: aboutbits/github-actions-kubernetes/kubectl-deploy@v3
3937
with:
4038
deployment-file: 'infrastructure/kubernetes.prod.yml'
4139
namespace-name: ${{ env.NAMESPACE_NAME }}
@@ -60,7 +58,7 @@ Deploy an application to a Kubernetes cluster using its Helm chart. Requires Kub
6058
#### Example
6159

6260
```yaml
63-
- uses: aboutbits/github-actions-kubernetes/helm-deploy@v2
61+
- uses: aboutbits/github-actions-kubernetes/helm-deploy@v3
6462
with:
6563
helm-chart-version: "1.0.0"
6664
helm-package: "my-app-chart"
@@ -99,16 +97,16 @@ In order to have a versioning in place and working, create lightweight tags that
9997
Creating a new minor release:
10098

10199
```bash
102-
git tag v2
100+
git tag v3
103101
git push --tags
104102
```
105103

106104
Replacing an already existing minor release:
107105

108106
```bash
109-
git tag -d v2
110-
git push origin :refs/tags/v2
111-
git tag v2
107+
git tag -d v3
108+
git push origin :refs/tags/v3
109+
git tag v3
112110
git push --tags
113111
```
114112

setup-kubectl-and-helm/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: 'Setup kubectl and Helm.'
2+
description: 'Setup kubectl and Helm using kubeconfig file.'
3+
4+
inputs:
5+
kubeconfig:
6+
description: 'The kubeconfig file content'
7+
required: true
8+
kubectl-version:
9+
description: 'kubectl version'
10+
required: false
11+
default: '1.33.1'
12+
helm-version:
13+
description: 'Helm version'
14+
required: false
15+
default: '3.17.3'
16+
17+
runs:
18+
using: "composite"
19+
steps:
20+
- name: Setup kubectl
21+
uses: azure/setup-kubectl@v4
22+
with:
23+
version: ${{ inputs.kubectl-version }}
24+
25+
- name: Setup kubeconfig file
26+
run: |
27+
mkdir -p ~/.kube
28+
echo "${{ inputs.kubeconfig }}" > ~/.kube/config
29+
chmod 600 ~/.kube/config
30+
31+
- name: Setup Helm
32+
uses: azure/setup-helm@v4
33+
with:
34+
version: ${{ inputs.helm-version }}

0 commit comments

Comments
 (0)