Skip to content

Commit 3fd82ba

Browse files
authored
feat: push helm charts in OCI format to ghcr.io (#134)
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
1 parent 685dc5b commit 3fd82ba

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/releases.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
release:
88
permissions:
99
contents: write
10+
packages: write
11+
id-token: write
1012
runs-on: ubuntu-latest
1113
steps:
1214
- name: Checkout
@@ -17,9 +19,31 @@ jobs:
1719
run: |
1820
git config user.name "$GITHUB_ACTOR"
1921
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
22+
23+
# Release tgz to github page
2024
- name: Run chart-releaser
2125
uses: helm/chart-releaser-action@v1.6.0
2226
with:
2327
config: "./cr.yaml"
2428
env:
2529
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
30+
31+
# Release to OCI registry
32+
- name: Login to GitHub Container Registry
33+
uses: docker/login-action@v3
34+
with:
35+
registry: ghcr.io
36+
username: ${{ github.actor }}
37+
password: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Push charts to GHCR
40+
run: |
41+
shopt -s nullglob
42+
for pkg in .cr-release-packages/*; do
43+
if [ -z "${pkg:-}" ]; then
44+
break
45+
fi
46+
lowercase=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')
47+
echo "Pushing package - ${pkg} to ghcr.io repository - ${lowercase}"
48+
helm push "${pkg}" "oci://ghcr.io/${lowercase}"
49+
done

0 commit comments

Comments
 (0)