Skip to content

Commit d286fc8

Browse files
[ADD] New CI
1 parent 76ea4ec commit d286fc8

File tree

3 files changed

+59
-87
lines changed

3 files changed

+59
-87
lines changed

.github/workflows/build-and-push-helm-chart.yaml

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Release Helm Chart
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Helm
22+
uses: azure/setup-helm@v3
23+
with:
24+
version: 'latest'
25+
26+
- name: Configure Docker for OCI
27+
run: |
28+
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io \
29+
--username ${{ github.actor }} \
30+
--password-stdin
31+
32+
- name: Extract version from tag
33+
id: get_version
34+
run: |
35+
# Remove 'v' prefix from tag
36+
VERSION="${GITHUB_REF#refs/tags/v}"
37+
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
38+
echo "Tag version: ${VERSION}"
39+
40+
- name: Update Chart.yaml with tag version
41+
run: |
42+
# Update the version in Chart.yaml to match the tag
43+
yq eval ".version = \"${{ steps.get_version.outputs.VERSION }}\"" -i Chart.yaml
44+
echo "Updated Chart.yaml version to ${{ steps.get_version.outputs.VERSION }}"
45+
cat Chart.yaml
46+
47+
- name: Package Helm chart as OCI artifact and push to GitHub Container Registry
48+
run: |
49+
# Package the chart and push to GitHub Container Registry
50+
helm package .
51+
52+
# Get chart name from Chart.yaml
53+
CHART_NAME=$(yq eval '.name' Chart.yaml)
54+
CHART_VERSION=$(yq eval '.version' Chart.yaml)
55+
56+
# Save as OCI artifact
57+
helm push ${CHART_NAME}-${CHART_VERSION}.tgz oci://ghcr.io/${{ github.repository_owner }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@ Icon[
2424
Network Trash Folder
2525
Temporary Items
2626
.apdisk
27+
28+
*.tgz

0 commit comments

Comments
 (0)