Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/publish-distribution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ jobs:
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db

- name: Log in to GitHub Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
shell: bash
env:
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
GITHUB_TOKEN_VALUE: ${{ github.token }}
run: |
username="${GHCR_USERNAME:-${GITHUB_ACTOR}}"
token="${GHCR_TOKEN:-${GITHUB_TOKEN_VALUE}}"
echo "::add-mask::${token}"
echo "${token}" | docker login ghcr.io --username "${username}" --password-stdin

- name: Extract image metadata
id: meta
Expand Down Expand Up @@ -98,10 +103,14 @@ jobs:
- name: Log in to GitHub Container Registry for Helm
shell: bash
run: |
echo "${TOKEN}" | helm registry login ghcr.io --username "${ACTOR}" --password-stdin
username="${GHCR_USERNAME:-${GITHUB_ACTOR}}"
token="${GHCR_TOKEN:-${GITHUB_TOKEN_VALUE}}"
echo "::add-mask::${token}"
echo "${token}" | helm registry login ghcr.io --username "${username}" --password-stdin
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
ACTOR: ${{ github.actor }}
GHCR_USERNAME: ${{ secrets.GHCR_USERNAME }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
GITHUB_TOKEN_VALUE: ${{ github.token }}

- name: Push Helm chart
shell: bash
Expand Down
10 changes: 10 additions & 0 deletions docs/operations/container-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,16 @@ It publishes on:
- push of tags matching `v*`
- manual workflow dispatch

Registry authentication for publish:

- default path: `github.token`
- fallback path: repository or organization secrets `GHCR_USERNAME` and
`GHCR_TOKEN`

Use the fallback secrets when the workflow can build successfully but GHCR
rejects the push with `403 Forbidden`. That usually means the package is not
granting write access to the repository-scoped workflow token.

## Helm Chart

The kernel also ships a standalone Helm chart:
Expand Down
Loading