diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml index 6c73c15..d6f71f7 100644 --- a/.github/workflows/helm-publish.yml +++ b/.github/workflows/helm-publish.yml @@ -1,10 +1,9 @@ -name: Helm publish on new commit and new version +name: Helm publish new version on: push: branches: - 'main' - - '!gh-pages' jobs: chart-publish: @@ -20,13 +19,33 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Helm Installation - uses: azure/setup-helm@v3 + - name: Set up Helm + uses: azure/setup-helm@v4 + with: + version: v3.12.0 - - name: Run chart-releaser for publish on new version - if: github.ref == 'refs/heads/main' - uses: helm/chart-releaser-action@main + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 with: - charts_dir: '.' + charts_dir: . + config: cr.yaml env: CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CR_SKIP_EXISTING: "true" + + - name: Login to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push charts to GHCR + run: | + shopt -s nullglob + for pkg in .cr-release-packages/*.tgz; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/geonetwork-helm-charts" + done diff --git a/README.md b/README.md index 6942c4f..000bd93 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,25 @@ Readme: https://github.com/geonetwork/geonetwork-helm-charts/tree/main/metadata- ### gn-tools-pipelines Readme: https://github.com/geonetwork/geonetwork-helm-charts/tree/main/gn-tools-pipelines + +# WARNING: New location storage for the helm chart - How to use + +All the helm chart are now stored inside the GitHub Docker registry. + +Please use it like so: + +## For helmfile.yaml + +``` +chart: oci://ghcr.io/geonetwork/geonetwork-helm-charts/myhelmchart +version: X.X.X +``` + +You don't need to include this anymore: +``` +repositories: + - name: geonetwork-helm-charts + url: https://helm-charts.geonetwork-opensource.org +``` + +Make sure to migrate to this new way of working. \ No newline at end of file