From cfb8391815c1cb3010043cd48e0509dd8e0742ac Mon Sep 17 00:00:00 2001 From: ricoberger Date: Sun, 19 Jan 2025 11:14:12 +0100 Subject: [PATCH] Use GitHub Container Registry to Store Helm Chart Instead of building and uploading the Helm Chart for the Vault Secrets Operator to the https://github.com/ricoberger/helm-charts repository, we are now using the GitHub Container Registry to store the Helm chart. Starting with the new version 3.0.0 the Helm chart will only be available at `ghcr.io/ricoberger/charts/vault-secrets-operator`. --- .github/workflows/continuous-delivery.yaml | 32 +++++++++++++++ .github/workflows/helm.yaml | 45 ---------------------- README.md | 5 +-- charts/vault-secrets-operator/Chart.yaml | 2 +- 4 files changed, 34 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/helm.yaml diff --git a/.github/workflows/continuous-delivery.yaml b/.github/workflows/continuous-delivery.yaml index e387dff..2fab43e 100644 --- a/.github/workflows/continuous-delivery.yaml +++ b/.github/workflows/continuous-delivery.yaml @@ -15,6 +15,7 @@ jobs: defaults: run: shell: bash + steps: - name: Checkout uses: actions/checkout@v4 @@ -62,3 +63,34 @@ jobs: tags: | ghcr.io/${{ github.repository }}:${{ env.TAG }} ricoberger/vault-secrets-operator:${{ env.TAG }} + + helm: + name: Helm + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + permissions: + contents: read + packages: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set Version + id: version + run: | + echo VERSION=$(yq -r .version ./charts/vault-secrets-operator/Chart.yaml) >> $GITHUB_ENV + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: ghcr.io + + - name: Package and Push Helm Chart + run: | + helm package ./charts/vault-secrets-operator --version ${{ env.VERSION }} + helm push ./vault-secrets-operator-${{ env.VERSION }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml deleted file mode 100644 index 8482447..0000000 --- a/.github/workflows/helm.yaml +++ /dev/null @@ -1,45 +0,0 @@ -name: Helm - -on: - push: - paths: - - 'charts/vault-secrets-operator/**' - -jobs: - build-release: - name: Helm Chart - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Lint - run: | - helm lint charts/vault-secrets-operator - - - name: Template - run: | - helm template vault-secrets-operator -n vault-secrets-operator charts/vault-secrets-operator - - - name: Configure git - run: git config --global user.email "mail@ricoberger.de" && git config --global user.name "ricoberger" - - - name: Package Helm Chart - if: ${{ github.ref == 'refs/heads/main' }} - run: helm package charts/vault-secrets-operator - - - name: Clone Helm Repository - if: ${{ github.ref == 'refs/heads/main' }} - run: git clone https://github.com/ricoberger/helm-charts.git - - - name: Update Helm Repository - if: ${{ github.ref == 'refs/heads/main' }} - run: mv vault-secrets-operator* helm-charts/ && helm repo index helm-charts/ --url https://ricoberger.github.io/helm-charts/ - - - name: Commit Changes - if: ${{ github.ref == 'refs/heads/main' }} - run: cd helm-charts/ && git add . && git commit -m "Add new release for Vault Secrets Operator" - - - name: Push Changes - if: ${{ github.ref == 'refs/heads/main' }} - run: cd helm-charts/ && git push https://ricoberger:${{ secrets.TOKEN }}@github.com/ricoberger/helm-charts.git diff --git a/README.md b/README.md index 9838b02..60e131a 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,7 @@ The **Vault Secrets Operator** creates Kubernetes secrets from Vault. The idea b The Vault Secrets Operator can be installed via Helm. A list of all configurable values can be found [here](./charts/README.md). The chart assumes a vault server running at `http://vault:8200`, but can be overidden by specifying `--set vault.address=https://vault.example.com` ```sh -helm repo add ricoberger https://ricoberger.github.io/helm-charts -helm repo update - -helm upgrade --install vault-secrets-operator ricoberger/vault-secrets-operator +helm upgrade --install vault-secrets-operator oci://ghcr.io/ricoberger/charts/vault-secrets-operator --version 3.0.0 ``` ### Prepare Vault diff --git a/charts/vault-secrets-operator/Chart.yaml b/charts/vault-secrets-operator/Chart.yaml index 5d496b8..8bcb94e 100644 --- a/charts/vault-secrets-operator/Chart.yaml +++ b/charts/vault-secrets-operator/Chart.yaml @@ -8,4 +8,4 @@ maintainers: - name: Rico Berger url: https://ricoberger.de name: vault-secrets-operator -version: 2.7.0 +version: 3.0.0