-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathaction.yml
93 lines (86 loc) · 2.53 KB
/
action.yml
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
81
82
83
84
85
86
87
88
89
90
91
92
93
name: 'Helm Publish Action'
description: 'Github Action to simplify Helm Chart publish into a Registry'
branding:
icon: package
color: yellow
inputs:
workingDirectory:
description: 'Working directory'
default: '.'
required: false
tailscaleKey:
description: 'Tailscale AuthKey'
default: ''
required: false
repository:
description: 'URL of your repository'
required: true
username:
description: 'Username to use on your repository'
required: true
password:
description: 'Password to use on your repository'
required: true
buildDependencies:
description: 'Build dependencies before push'
default: 'false'
updateDependencies:
description: 'Update dependencies before push'
default: 'false'
beforeHook:
description: 'Command to execute before publishing'
default: ''
required: false
runs:
using: "composite"
steps:
- name: Install Helm
shell: bash
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
helm plugin install https://github.com/chartmuseum/helm-push
- name: Tailscale
uses: tailscale/github-action@v1
if: ${{ inputs.tailscaleKey != '' }}
with:
authkey: ${{ inputs.tailscaleKey }}
- name: Add repository
shell: bash
run: |
helm repo add charts ${{ inputs.repository }}
- name: Execute Before Hook
shell: bash
if: ${{ inputs.beforeHook != '' }}
working-directory: ${{ inputs.workingDirectory }}
run: ${{ inputs.beforeHook }}
- name: Update dependencies
shell: bash
if: ${{ inputs.updateDependencies == 'true' }}
working-directory: ${{ inputs.workingDirectory }}
env:
HELM_REPO_USERNAME: ${{ inputs.username }}
HELM_REPO_PASSWORD: ${{ inputs.password }}
run: |
helm dependencies update
- name: Build dependencies
shell: bash
if: ${{ inputs.buildDependencies == 'true' }}
working-directory: ${{ inputs.workingDirectory }}
env:
HELM_REPO_USERNAME: ${{ inputs.username }}
HELM_REPO_PASSWORD: ${{ inputs.password }}
run: |
helm dependencies build
- name: Lint
shell: bash
working-directory: ${{ inputs.workingDirectory }}
run: |
helm lint
- name: Publish
shell: bash
working-directory: ${{ inputs.workingDirectory }}
env:
HELM_REPO_USERNAME: ${{ inputs.username }}
HELM_REPO_PASSWORD: ${{ inputs.password }}
run: |
helm cm-push . charts