Skip to content
Merged
34 changes: 34 additions & 0 deletions deploy-helm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 'Deploy Helm chart to Kubernetes'
description: 'Deploy an application to a Kubernetes cluster using its Helm chart'

inputs:
release-name:
description: 'The name of the Helm release'
required: true
chart-path:
description: 'Path to the Helm chart'
default: '.'
values-file:
description: 'Path to the Helm values file'
required: true
image-tag:
description: 'Tag of the container image'
default: 'latest'
timeout:
description: 'Timeout for the Helm command'
default: '5m'
working-directory:
description: 'The working directory'
default: '.'

runs:
using: "composite"
steps:
- name: Deploy Helm Chart
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
helm upgrade --wait --install ${{ inputs.release-name }} ${{ inputs.chart-path }} \
--values ${{ inputs.values-file }} \
--atomic --timeout ${{ inputs.timeout }} \
--set image.tag=${{ inputs.image-tag }}
3 changes: 3 additions & 0 deletions do-setup-kubectl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ runs:
- name: Save DigitalOcean kubeconfig with short-lived credentials
run: doctl kubernetes cluster kubeconfig save --expiry-seconds 600 ${{ inputs.cluster-name }}
shell: bash

- name: Setup helm
uses: azure/setup-helm@v4.2.0
29 changes: 29 additions & 0 deletions readme.md

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about renaming aboutbits/github-actions-kubernetes/deploy to aboutbits/github-actions-kubernetes/kubectl-deploy? We could just simply release everything with version 2 then it should not be a problem and we have it more evident for the future?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I increace the verison, then I adjust also always in the readme under the section Versioning all the references of v1 to v2.

Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,35 @@ The following inputs can be used as `step.with` keys:
| `deployment-name` | required | Kubernetes deployment name |
| `working-directory` | `.` | The working directory |

### Deploy to Kubernetes using Helm

Deploy an application to a Kubernetes cluster using its Helm diagram. Requires Kubernetes to be configured first.

#### Example

```yaml
- uses: ./.github/actions/helm-deploy

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: ./.github/actions/helm-deploy
- uses: aboutbits/github-actions-kubernetes/helm-deploy@v1

with:
release-name: my-app
chart-path: my-chart
image-tag: "1.0.0"
values-file: environments/values-test.yaml
timeout: 5m
working-directory: ./infrastructure
```

#### Inputs

The following inputs can be used as `step.with` keys:

| Name | Required/Default | Description |
|---------------------|------------------|------------------------------|
| `release-name` | required | The name of the Helm release |
| `values-file` | required | Path to the Helm values file |
| `working-directory` | `.` | The working directory |
| `chart-path` | `.` | Path to the Helm chart |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are referencing twice a folder, but one time you call it directory and one time path. Would it make sense to align the names?

| `image-tag` | `latest` | Tag of the container image |
| `timeout` | `5m` | Timeout for the Helm command |

## Versioning

Expand Down