-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (54 loc) · 1.54 KB
/
publish-helm.yaml
File metadata and controls
65 lines (54 loc) · 1.54 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
name: Publish Helm Chart
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:
env:
REGISTRY: ghcr.io
jobs:
publish-helm:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: 'latest'
- name: Determine tag
id: tag
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
else
TAG=v25.7.1-${GITHUB_SHA::7}
fi
echo "tag=${TAG}" >> $GITHUB_OUTPUT
- name: Log in to Container Registry
if: github.event_name != 'pull_request'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ github.actor }} --password-stdin
- name: Build Helm chart
if: github.event_name == 'pull_request'
run: |
make helm-build TAG=${{ steps.tag.outputs.tag }} REGISTRY=ghcr.io/mellanox
- name: Build and publish Helm chart
if: github.event_name != 'pull_request'
run: |
make helm-publish TAG=${{ steps.tag.outputs.tag }} REGISTRY=ghcr.io/mellanox