Skip to content
Merged
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
34 changes: 34 additions & 0 deletions helm-deploy/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'

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
chart-path:
description: 'Path to the Helm chart'
chart-directory:
description: 'The directory of 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 }}
File renamed without changes.
33 changes: 31 additions & 2 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 @@ -11,7 +11,7 @@ Setup Digital-Ocean CLI and configure Kubernetes.
#### Example

```yaml
- uses: aboutbits/github-actions-kubernetes/do-setup-kubectl@v1
- uses: aboutbits/github-actions-kubernetes/do-setup-kubectl@v2
with:
digital-ocean-token: ${{ secrets.DIGITALOCEAN_TOKEN }}
cluster-name: ${{ env.CLUSTER_NAME }}
Expand All @@ -34,7 +34,7 @@ Deploy application to a Kubernetes Cluster. Requires Kubernetes to be configured
#### Example

```yaml
- uses: aboutbits/github-actions-kubernetes/deploy@v1
- uses: aboutbits/github-actions-kubernetes/kubectl-deploy@v2

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.

Please adjust also the title: Deploy to Kuberentes using kubectl.

with:
deployment-file: 'infrastructure/kubernetes.prod.yml'
namespace-name: ${{ env.NAMESPACE_NAME }}
Expand All @@ -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: aboutbits/github-actions-kubernetes/helm-deploy@v2
with:
release-name: my-app
chart-directory: 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-directory` | `.` | Root directory of the helm diagram |
| `image-tag` | `latest` | Tag of the container image |
| `timeout` | `5m` | Timeout for the Helm command |

## Versioning

Expand Down