-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
80 lines (74 loc) · 2.56 KB
/
Copy pathaction.yml
File metadata and controls
80 lines (74 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: "Helm Chart Setup and Deployment"
description: "Setup a Helm chart, modify its appVersion, and deploy it to a Kubernetes cluster"
inputs:
helm-chart-version:
description: "The Helm chart version"
required: true
helm-registry-url:
description: "The Helm OCI registry URL"
required: true
helm-package:
description: "The Helm package"
required: true
helm-username:
description: "The username to authenticate with the Helm registry"
required: true
helm-password:
description: "The password to authenticate with the Helm registry"
required: true
helm-protocol:
description: "The protocol for fetching the Helm chart (e.g., oci://). Default is 'oci://'."
default: "oci://"
release-name:
description: "The name of the Helm release"
required: true
namespace:
description: "The namespace in which to deploy the Helm chart and application"
required: true
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: Login to Helm registry
shell: bash
run: |
helm registry login ${{ inputs.helm-registry-url }} \
-u ${{ inputs.helm-username }} \
-p ${{ inputs.helm-password }}
- name: Pull the Helm chart
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
helm pull ${{ inputs.helm-protocol }}${{ inputs.helm-registry-url }}/${{ inputs.helm-package }} \
--version ${{ inputs.helm-chart-version }}
- name: Extract Helm chart
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
tar -xzf ${{ inputs.helm-package }}-*.tgz
- name: Update appVersion in Chart.yaml
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
yq -i '.appVersion = "${{ github.sha }}" | .appVersion style="double"' \
${{ inputs.helm-package }}/Chart.yaml
- name: Deploy Helm chart
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
helm upgrade --wait --install ${{ inputs.release-name }} ./${{ inputs.helm-package }} \
--namespace ${{ inputs.namespace }}
--values ${{ inputs.values-file }} \
--atomic --timeout ${{ inputs.timeout }} \
--set image.tag=${{ inputs.image-tag }}