From a0191a794d176138d6e31d615944e5435757b244 Mon Sep 17 00:00:00 2001 From: Zack Hodgson Brady Date: Sun, 11 Feb 2024 09:36:34 -0500 Subject: [PATCH] improved github actions workflow --- .github/workflows/main.yaml | 29 ++++++++++++++++---------- README.md | 10 +++++++-- charts/cluster-templates/README.md | 16 +++++++------- charts/cluster-templates/app-readme.md | 16 +++++++------- 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 000740a..666365c 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,4 +1,4 @@ -name: Helm Chart Release +name: Release Helm Chart(s) on: push: branches: @@ -18,16 +18,23 @@ jobs: git config user.name "$GITHUB_ACTOR" git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - - name: Helm Chart Releaser - uses: helm/chart-releaser-action@v1.5.0 + - name: Run Helm Chart Releaser + uses: helm/chart-releaser-action@v1.6.0 env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - - name: Build and Push Helm Chart + - name: Authenticate to GHCR + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push Chart(s) to GHCR run: | - cd charts/cluster-templates - helm package . - ls -la - echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u rancherfederal --password-stdin - export CHART_VERSION=$(grep 'version:' Chart.yaml | tail -n1 | awk '{ print $2}') - helm push rancher-cluster-templates-${CHART_VERSION}.tgz oci://ghcr.io/rancherfederal \ No newline at end of file + for pkg in .cr-release-packages/*; do + if [ -z "${pkg:-}" ]; then + break + fi + helm push "${pkg}" oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts + done diff --git a/README.md b/README.md index f42afb7..b5908ad 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,20 @@ This project contains the Helm Chart for Rancher Cluster Templates, which provid ## Configuration -### Adding the Helm Chart via CLI: +### Adding the Helm Chart via CLI ```bash helm repo add cluster-templates https://rancherfederal.github.io/rancher-cluster-templates helm repo update ``` -### Adding the Helm Chart via Rancher Manager: +### Adding the Helm Chart via OCI + +```bash +ghcr.io/rancherfederal/charts/rancher-cluster-templates +``` + +### Adding the Helm Chart via Rancher Manager 1. Authenticate into the Rancher Manager UI 2. Open the local cluster or downstream cluster diff --git a/charts/cluster-templates/README.md b/charts/cluster-templates/README.md index f58eee6..ca8a1d9 100644 --- a/charts/cluster-templates/README.md +++ b/charts/cluster-templates/README.md @@ -10,16 +10,16 @@ ### Currently Available -* AWS Commercial -* AWS GovCloud -* Harvester -* Digital Ocean -* Custom +- AWS Commercial +- AWS GovCloud +- Harvester +- Digital Ocean +- Custom ### Pending Development -* VMWare vSphere -* Microsoft Azure +- VMWare vSphere +- Microsoft Azure ## Installing the Chart @@ -29,7 +29,7 @@ helm upgrade -i cluster cluster-templates/rancher-cluster-templates -n fleet-def ``` ```bash -helm upgrade -i cluster oci://ghcr.io/rancherfederal/rancher-cluster-templates -n fleet-default -f values.yaml +helm upgrade -i cluster oci://ghcr.io/rancherfederal/charts/rancher-cluster-templates -n fleet-default -f values.yaml ``` ## Helm Chart Deployment Status diff --git a/charts/cluster-templates/app-readme.md b/charts/cluster-templates/app-readme.md index f58eee6..ca8a1d9 100644 --- a/charts/cluster-templates/app-readme.md +++ b/charts/cluster-templates/app-readme.md @@ -10,16 +10,16 @@ ### Currently Available -* AWS Commercial -* AWS GovCloud -* Harvester -* Digital Ocean -* Custom +- AWS Commercial +- AWS GovCloud +- Harvester +- Digital Ocean +- Custom ### Pending Development -* VMWare vSphere -* Microsoft Azure +- VMWare vSphere +- Microsoft Azure ## Installing the Chart @@ -29,7 +29,7 @@ helm upgrade -i cluster cluster-templates/rancher-cluster-templates -n fleet-def ``` ```bash -helm upgrade -i cluster oci://ghcr.io/rancherfederal/rancher-cluster-templates -n fleet-default -f values.yaml +helm upgrade -i cluster oci://ghcr.io/rancherfederal/charts/rancher-cluster-templates -n fleet-default -f values.yaml ``` ## Helm Chart Deployment Status