-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (49 loc) · 1.68 KB
/
helm-publish.yml
File metadata and controls
61 lines (49 loc) · 1.68 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
name: Package and Push Helm Chart
on:
push:
branches: [main]
tags: ['*']
jobs:
helm-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up Helm
uses: azure/setup-helm@v4.3.1
- name: Log in to Container Registry
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Add Helm dependency repositories
run: |
helm repo add dandydev https://dandydeveloper.github.io/charts
helm repo update
- name: Update Helm dependencies
run: |
helm dependency update chart/
- name: Get version
id: version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
else
VERSION="0.0.0-latest"
fi
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Update chart version
run: |
sed -i "s/^version:.*/version: ${{ steps.version.outputs.version }}/" chart/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${{ steps.version.outputs.version }}\"/" chart/Chart.yaml
- name: Lint Helm chart
run: |
helm lint chart/
- name: Package Helm chart
run: |
helm package chart/ --destination .
- name: Push Helm chart to OCI registry
run: |
OWNER=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
helm push s3proxy-python-${{ steps.version.outputs.version }}.tgz oci://ghcr.io/${OWNER}/charts