Skip to content

Commit 2bf2d3a

Browse files
authored
fix(ci): push Helm Chart to GHCR #720
Fixes: #713 Signed-off-by: Devin Buhl <onedr0p@users.noreply.github.com>
1 parent 424b029 commit 2bf2d3a

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/release.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ on:
1313

1414
jobs:
1515
release:
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
17+
permissions:
18+
contents: write
19+
packages: write
1720
steps:
1821
- name: Checkout
1922
uses: actions/checkout@v4
@@ -26,11 +29,10 @@ jobs:
2629
git config user.name "$GITHUB_ACTOR"
2730
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
2831
29-
# See https://github.com/helm/chart-releaser-action/issues/6
3032
- name: Set up Helm
3133
uses: azure/setup-helm@v4
3234
with:
33-
version: v3.14.4
35+
version: v3.17.2
3436

3537
- name: Add dependency chart repos
3638
run: |
@@ -39,6 +41,26 @@ jobs:
3941
4042
- name: Run chart-releaser
4143
uses: helm/chart-releaser-action@v1.7.0
44+
id: cr
4245
env:
4346
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
4447
CR_GENERATE_RELEASE_NOTES: true
48+
CR_SKIP_EXISTING: true
49+
50+
- if: ${{ steps.cr.outputs.changed_charts }}
51+
name: Login to GitHub Container Registry
52+
uses: docker/login-action@v3
53+
with:
54+
registry: ghcr.io
55+
username: ${{ github.repository_owner }}
56+
password: ${{ secrets.GITHUB_TOKEN }}
57+
58+
- if: ${{ steps.cr.outputs.changed_charts }}
59+
name: Push Charts to GHCR
60+
run: |
61+
for pkg in .cr-release-packages/*; do
62+
if [ -z "${pkg:-}" ]; then
63+
break
64+
fi
65+
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}
66+
done

0 commit comments

Comments
 (0)