diff --git a/.github/workflows/helm-publish.yml b/.github/workflows/helm-publish.yml index 14a3727..590ef3f 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,43 +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: Checkout gh-pages branch - uses: actions/checkout@v3 + - name: Login to GHCR + uses: docker/login-action@v3 with: - fetch-depth: 0 - ref: 'gh-pages' - path: gh-pages + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Helm Package all the charts using commit ID and remove chart packages older than 6 months - shell: bash + - name: Push charts to GHCR run: | - mv gh-pages /tmp/gh-pages - for directory in *; do - if [ -d "$directory" ]; then - helm package "$directory" -d /tmp/gh-pages --version $(helm show chart "$directory" |grep ^version: | awk '{print $2}')-"$GITHUB_REF_NAME"-"${GITHUB_SHA::7}" + 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}/helm-charts" done - cd /tmp/gh-pages - find . -type f -mtime +180 -delete - helm repo index . --merge index.yaml - cd $GITHUB_WORKSPACE - mv /tmp/gh-pages . - - - name: Deploy to GitHub Pages the charts based on the commit ID - uses: crazy-max/ghaction-github-pages@v3 - with: - target_branch: gh-pages - build_dir: gh-pages - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md new file mode 100644 index 0000000..6af4f5e --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# WARNING: New location storage for the helm chart + +All the helm chart are now stored inside the GitHub Docker registry. + +Please use it like so: + +## For helmfile.yaml + +``` +chart: oci://ghcr.io/camptocamp/charts-gs/myhelmchart +version: X.X.X +``` + +You don't need to include this anymore: +``` +repositories: + - name: charts-gs + url: https://camptocamp.github.io/charts-gs/ +``` + +Make sure to migrate to this new way of working. + +## When installing manually + +``` +helm install myapp oci://ghcr.io/camptocamp/charts-gs/myhelmchart --version X.X.X +``` \ No newline at end of file diff --git a/cr.yaml b/cr.yaml new file mode 100644 index 0000000..64fe889 --- /dev/null +++ b/cr.yaml @@ -0,0 +1,5 @@ +sign: false + +# Enable automatic generation of release notes using GitHubs release notes generator. +# see: https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes +generate-release-notes: true \ No newline at end of file