Skip to content

Charts: Release to GHCR OCI #5

Charts: Release to GHCR OCI

Charts: Release to GHCR OCI #5

name: "Charts: Release to GHCR OCI"
on:
workflow_dispatch: {}
push:
branches: [main]
paths:
- "chart/**/*"
jobs:
release-charts:
name: Release chart
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v4
- name: Run chart-releaser
uses: helm/[email protected]
env:
skip_upload: true
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
charts_dir: chart
- name: Push Charts to GHCR
run: |
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" oci://ghcr.io/${{ github.repository }}/chart
done