diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml new file mode 100644 index 000000000..90dd1edfc --- /dev/null +++ b/.github/workflows/helm-release.yaml @@ -0,0 +1,44 @@ +name: Release Charts + +on: + push: + branches: + - main + paths: + - 'charts/*' + +permissions: read-all + +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: write # to push chart release and create a release (helm/chart-releaser-action) + packages: write # needed for ghcr access + id-token: write # needed for keyless signing + steps: + - name: Checkout + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4 + + # see https://github.com/helm/chart-releaser/issues/183 + - name: Login to GitHub Container Registry + uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push chart to GHCR + run: | + helm package charts + helm push answer-*.tgz oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts diff --git a/charts/Chart.yaml b/charts/Chart.yaml index ff77995f0..8bbf44122 100644 --- a/charts/Chart.yaml +++ b/charts/Chart.yaml @@ -20,4 +20,4 @@ name: answer description: A simple answer deployments for kubernetes type: application version: 0.1.0 -appVersion: "1.0.7" \ No newline at end of file +appVersion: "1.7.0" diff --git a/charts/README.md b/charts/README.md index 26cd6a9cf..956910eff 100644 --- a/charts/README.md +++ b/charts/README.md @@ -63,13 +63,18 @@ $ helm install answer -f values.yaml . ``` > **Tip**: You can use the default [values.yaml] -## TODO +### Installing from the OCI registry -Publish the chart to Artifacthub and add proper installation instructions. E.G. -> **NOTE**: This is not currently a valid installation option. +The chart is published to the GitHub Container Registry and can be installed directly with Helm 3.8+. ```console -$ helm repo add apache https://charts.answer.apache.org/ -$ helm repo update -$ helm install apache/answer -n mynamespace +$ helm install answer oci://ghcr.io/apache/charts/answer --version 0.1.0 +``` + +If you want to inspect or tweak values first, pull the chart and install from the unpacked directory: + +```console +$ helm pull oci://ghcr.io/apache/charts/answer --version 0.1.0 +$ tar -xzf answer-0.1.0.tgz +$ helm install answer ./answer -f values.yaml ``` \ No newline at end of file diff --git a/charts/values.yaml b/charts/values.yaml index d932db848..fdc4e739f 100644 --- a/charts/values.yaml +++ b/charts/values.yaml @@ -23,9 +23,7 @@ replicaCount: 1 image: repository: apache/answer - pullPolicy: Always - # Overrides the image tag whose default is the chart appVersion. - tag: "latest" + pullPolicy: IfNotPresent # Environment variables # Configure environment variables below