Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for publishing to Github Container Registry OCI registry #141

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
19 changes: 18 additions & 1 deletion .github/workflows/helm_release.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
name: Release Charts

env:
HELM_VERSION_TO_INSTALL: 3.14.0
GCR_IMAGE: ghcr.io/${{ github.repository_owner }}

on:
workflow_dispatch:

jobs:
release:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -33,3 +37,16 @@ jobs:
cr package
cr upload --owner="$owner" --git-repo "$repo" --token="$CR_TOKEN" --release-name-template="v{{ .Version }}" --packages-with-index --push --skip-existing --generate-release-notes --commit main
cr index --owner="$owner" --git-repo "$repo" --token="$CR_TOKEN" --release-name-template="v{{ .Version }}" --packages-with-index --push --index-path="."

- name: install helm
uses: Azure/[email protected]
with:
# Version of helm
version: ${{ env.HELM_VERSION_TO_INSTALL }} # default is latest

- name: publish to oci registry
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ github.repository_owner }} --password-stdin
helm package ${{ github.workspace }}/
package=`ls -t docker-registry-*.tgz | head -n 1`
helm push "${package}" oci://${{ env.GCR_IMAGE }}