-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
73 lines (68 loc) · 2.52 KB
/
action.yaml
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
name: "Helm Chart Release"
description: "Package and release helm charts to an S3 bucket"
inputs:
aws-access-key-id:
description: "The AWS access key with permissions to push to S3"
required: true
aws-region:
description: "The AWS region where there S3 bucket is created"
required: true
aws-secret-access-key:
description: "The AWS secret access key"
required: true
chart-directory:
description: "The directory where the helm charts are stored"
required: true
chart-version:
description: "The chart version number to use"
required: true
docker-image-version:
description: "The docker image version to set in the helm chart"
required: false
s3-bucket:
description: "The S3 bucket to push to"
required: true
skip-aws-setup:
description: "Skip the AWS setup process if it has been run in the same job already"
required: false
default: "false"
skip-helm-setup:
description: "Skip the helm setup process if it has been run in the same job already"
required: false
default: "false"
skip-helm-publish:
description: "Skip publishing the chart"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Configure AWS Credentials
if: ${{ inputs.skip-aws-setup == 'false' }}
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: ${{ inputs.aws-region }}
- name: Setup Helm
if: ${{ inputs.skip-helm-setup == 'false' }}
uses: azure/setup-helm@v3
- name: Setup Helm S3 Plugin
if: ${{ inputs.skip-helm-setup == 'false' }}
shell: bash
run: |
helm plugin install https://github.com/hypnoglow/helm-s3.git --version 0.14.0
- name: Set Docker Image Tag
if: ${{ inputs.docker-image-version != '' }}
shell: bash
run: yq -i '.aruba-uxi.global.image.tag = "${{ inputs.docker-image-version }}"' ${{ inputs.chart-directory }}/values.yaml
- name: Publish Chart
if: ${{ inputs.skip-helm-publish == 'false' }}
shell: bash
run: |
export CHART_DIR=${{ inputs.chart-directory }}
helm repo remove aruba-uxi || true
helm repo add aruba-uxi ${{ inputs.s3-bucket }}
helm dependency update ${CHART_DIR}
helm package ${CHART_DIR} --destination chart-packages --version ${{ inputs.chart-version }}
helm s3 push chart-packages/$(ls chart-packages) aruba-uxi --ignore-if-exists