Skip to content

Commit

Permalink
feat: push helm charts in OCI format to ghcr.io (#134)
Browse files Browse the repository at this point in the history
Signed-off-by: Ludovic Ortega <ludovic.ortega@adminafk.fr>
  • Loading branch information
M0NsTeRRR authored Nov 22, 2024
1 parent 685dc5b commit 3fd82ba
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
release:
permissions:
contents: write
packages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -17,9 +19,31 @@ jobs:
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
# Release tgz to github page
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
with:
config: "./cr.yaml"
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

# Release to OCI registry
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
lowercase=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')
echo "Pushing package - ${pkg} to ghcr.io repository - ${lowercase}"
helm push "${pkg}" "oci://ghcr.io/${lowercase}"
done

0 comments on commit 3fd82ba

Please sign in to comment.