-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (50 loc) · 1.57 KB
/
Copy pathhelm.yml
File metadata and controls
56 lines (50 loc) · 1.57 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
name: Helm package
on:
push:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- '*.md'
- '*.adoc'
- '*.txt'
pull_request:
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
- 'LICENSE'
- '*.md'
- '*.adoc'
- '*.txt'
jobs:
helm-package:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: ./.github/workflows/env_setup
- name: Install Helm
run: |
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- name: Verify Helm installation
run: helm version
- name: Login to GitHub Container Registry
if: env.PROTECTED_RUN == 'true'
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Helm package
run: |
export VERSION=999
if [[ "${{ github.ref_type }}" == "tag" && "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
export VERSION=$(echo -n "${{ github.ref_name }}" | sed 's/^v//g')
fi
helm package dist/chart -u --version ${VERSION} --app-version ${VERSION}
if [[ "${VERSION}" != "999" && "${PROTECTED_RUN}" == "true" ]]; then
helm push "nodedrain-${VERSION}.tgz" "oci://ghcr.io/slyngdk/charts"
fi