-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Add OCI publishing for Helm charts to GHCR #8878
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
base: master
Are you sure you want to change the base?
Changes from all commits
6cd2e73
e500a25
6fb9552
347fec8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,10 +5,11 @@ jobs: | |
| ca-release: | ||
| permissions: | ||
| contents: write # for helm/chart-releaser-action to push chart release and create a release | ||
| packages: write # for pushing charts to GHCR | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4.2.2 | ||
| uses: actions/checkout@v6.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
|
|
@@ -18,9 +19,9 @@ jobs: | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
|
|
||
| - name: Install Helm | ||
| uses: azure/setup-helm@v4.2.0 | ||
| uses: azure/setup-helm@v4.3.1 | ||
| with: | ||
| version: v3.4.0 | ||
| version: v3.19.2 | ||
|
|
||
| - env: | ||
| CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
@@ -29,13 +30,29 @@ jobs: | |
| uses: helm/[email protected] | ||
| with: | ||
| charts_dir: cluster-autoscaler/charts | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/[email protected] | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Push charts to GHCR | ||
| run: | | ||
| set -e | ||
| shopt -s nullglob | ||
| for pkg in .cr-release-packages/*; do | ||
| helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that the container registry is per "owner" (ie, in our case that would be kubernetes, not kubernetes/autoscaler) I have no idea what the permission model is around that
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to find out whether the kubernetes org allows workflows to create new packages. This is controlled by the org's "Packages" settings. If package creation is restricted, the first push would fail and we'd need an org admin to either pre-create the package or adjust the org settings. I can add a note in the PR description about this, or we could do a test run with workflow_dispatch to verify it works before merging. What do you think? |
||
| done | ||
| vpa-release: | ||
| permissions: | ||
| contents: write # for helm/chart-releaser-action to push chart release and create a release | ||
| packages: write # for pushing charts to GHCR | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4.2.2 | ||
| uses: actions/checkout@v6.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
|
|
@@ -45,9 +62,9 @@ jobs: | |
| git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
|
|
||
| - name: Install Helm | ||
| uses: azure/setup-helm@v4.2.0 | ||
| uses: azure/setup-helm@v4.3.1 | ||
| with: | ||
| version: v3.4.0 | ||
| version: v3.19.2 | ||
|
|
||
| - env: | ||
| CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
@@ -56,8 +73,24 @@ jobs: | |
| uses: helm/[email protected] | ||
| with: | ||
| charts_dir: vertical-pod-autoscaler/charts | ||
|
|
||
| - name: Login to GitHub Container Registry | ||
| uses: docker/[email protected] | ||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Push charts to GHCR | ||
| run: | | ||
| set -e | ||
| shopt -s nullglob | ||
| for pkg in .cr-release-packages/*; do | ||
| helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts" | ||
willianpaixao marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| done | ||
| name: Release Charts | ||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| workflow_dispatch: | ||
willianpaixao marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.