From 7a47a44410938d0bf83e252f204cec03d2877a48 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Mon, 22 Jan 2024 15:20:45 +0100 Subject: [PATCH 1/8] feat: add helm chart release action to publish helm chart --- .github/workflows/helm-chart-release.yml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/helm-chart-release.yml diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml new file mode 100644 index 000000000..1ec29c2c7 --- /dev/null +++ b/.github/workflows/helm-chart-release.yml @@ -0,0 +1,38 @@ +name: Release Helm Charts + +on: + push: + branches: + - main + paths: + - 'charts/**' + +jobs: + release: + # depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions + # see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + 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@v3 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.6.0 + env: + CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + with: + charts_dir: charts + pages_branch: main + packages_with_index: true From 6230bafa79ca01d1fcd4849726880b3597c063cc Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Mon, 22 Jan 2024 15:22:09 +0100 Subject: [PATCH 2/8] chore: disable branch check for testing --- .github/workflows/helm-chart-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 1ec29c2c7..4a507b999 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -2,8 +2,8 @@ name: Release Helm Charts on: push: - branches: - - main + # branches: + # - main paths: - 'charts/**' From e66933456f059ed5c4820c57e60180cf63209af7 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Mon, 22 Jan 2024 15:47:42 +0100 Subject: [PATCH 3/8] chore: disable branch check for testing --- charts/openstad-headless/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/openstad-headless/Chart.yaml b/charts/openstad-headless/Chart.yaml index 980c4fa74..708eb7324 100644 --- a/charts/openstad-headless/Chart.yaml +++ b/charts/openstad-headless/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: openstad-headless -description: A Helm chart for Kubernetes +description: Openstad Headless Helm chart for Kubernetes # A chart can be either an 'application' or a 'library' chart. # From 8326f92f3168e79e9822f614542b2dc161d45132 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Mon, 22 Jan 2024 16:33:30 +0100 Subject: [PATCH 4/8] fix: install helm dependencies --- .github/workflows/helm-chart-release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 4a507b999..22fff7f66 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -27,6 +27,14 @@ jobs: - name: Install Helm uses: azure/setup-helm@v3 + with: + version: v3.5.4 + + - name: Helm Deps + run: | + for dir in $(ls -d charts/*); do + helm dependency update $dir; + done - name: Run chart-releaser uses: helm/chart-releaser-action@v1.6.0 From 717139cb86b673b3ca960b4fea5ba1f5edcee2d5 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Mon, 22 Jan 2024 16:34:40 +0100 Subject: [PATCH 5/8] fix: install helm dependencies --- .github/workflows/helm-chart-release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 22fff7f66..9adc10a59 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -2,10 +2,11 @@ name: Release Helm Charts on: push: - # branches: + branches: + - '**' # - main - paths: - - 'charts/**' + # paths: + # - 'charts/**' jobs: release: @@ -33,7 +34,7 @@ jobs: - name: Helm Deps run: | for dir in $(ls -d charts/*); do - helm dependency update $dir; + helm dependency update $dir; done - name: Run chart-releaser From b9a8c97fe054c5de94206852d83d7cd98843e132 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Mon, 22 Jan 2024 16:38:38 +0100 Subject: [PATCH 6/8] fix: install helm dependencies --- .github/workflows/helm-chart-release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 9adc10a59..a7b42aed7 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -33,8 +33,8 @@ jobs: - name: Helm Deps run: | - for dir in $(ls -d charts/*); do - helm dependency update $dir; + for dir in $(ls -d charts/*/); do + helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done done - name: Run chart-releaser From 1de010dd4ef76199a99d7292647ab4f560ac5777 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Tue, 23 Jan 2024 08:32:24 +0100 Subject: [PATCH 7/8] fix: keep default branch of gh-pages --- .github/workflows/helm-chart-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index a7b42aed7..94845c5ca 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -43,5 +43,4 @@ jobs: CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' with: charts_dir: charts - pages_branch: main packages_with_index: true From ff56f6b1b6978017327acf7f1fbc162593513081 Mon Sep 17 00:00:00 2001 From: Daan Rosbergen Date: Wed, 24 Jan 2024 08:46:46 +0100 Subject: [PATCH 8/8] chore: reenable correct workflow trigger --- .github/workflows/helm-chart-release.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/helm-chart-release.yml b/.github/workflows/helm-chart-release.yml index 94845c5ca..1b72744bf 100644 --- a/.github/workflows/helm-chart-release.yml +++ b/.github/workflows/helm-chart-release.yml @@ -3,10 +3,9 @@ name: Release Helm Charts on: push: branches: - - '**' - # - main - # paths: - # - 'charts/**' + - main + paths: + - 'charts/**' jobs: release: @@ -43,4 +42,3 @@ jobs: CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}' with: charts_dir: charts - packages_with_index: true