From a415f37bec8bd40b6ff508ca86cd558842f55aad Mon Sep 17 00:00:00 2001 From: Jesper Svendsen <99078145+jesper7@users.noreply.github.com> Date: Mon, 28 Nov 2022 14:46:55 +0100 Subject: [PATCH] Set up Helm repository and automatic releases (#13) --- .github/workflows/helm.yaml | 75 +++++++++++++++++++ {studio => charts/studio}/.helmignore | 0 {studio => charts/studio}/Chart.lock | 4 +- {studio => charts/studio}/Chart.yaml | 0 {studio => charts/studio}/templates/NOTES.txt | 0 .../studio}/templates/_env_vars.tpl | 0 .../studio}/templates/_helpers.tpl | 0 .../studio}/templates/configmap.yaml | 0 .../templates/deployment-studio-backend.yaml | 0 .../templates/deployment-studio-beat.yaml | 0 .../templates/deployment-studio-ui.yaml | 0 .../templates/deployment-studio-worker.yaml | 0 .../studio}/templates/hpa-studio-backend.yaml | 0 .../studio}/templates/hpa-studio-beat.yaml | 0 .../studio}/templates/hpa-studio-ui.yaml | 0 .../studio}/templates/hpa-studio-worker.yaml | 0 .../studio}/templates/ingress-backend.yaml | 0 .../studio}/templates/ingress-ui.yaml | 0 .../studio}/templates/secrets.yaml | 0 .../studio}/templates/service-backend.yaml | 0 .../studio}/templates/service-ui.yaml | 0 .../studio}/templates/serviceaccount.yaml | 0 .../templates/tests/test-connection.yaml | 0 {studio => charts/studio}/values.yaml | 0 24 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/helm.yaml rename {studio => charts/studio}/.helmignore (100%) rename {studio => charts/studio}/Chart.lock (67%) rename {studio => charts/studio}/Chart.yaml (100%) rename {studio => charts/studio}/templates/NOTES.txt (100%) rename {studio => charts/studio}/templates/_env_vars.tpl (100%) rename {studio => charts/studio}/templates/_helpers.tpl (100%) rename {studio => charts/studio}/templates/configmap.yaml (100%) rename {studio => charts/studio}/templates/deployment-studio-backend.yaml (100%) rename {studio => charts/studio}/templates/deployment-studio-beat.yaml (100%) rename {studio => charts/studio}/templates/deployment-studio-ui.yaml (100%) rename {studio => charts/studio}/templates/deployment-studio-worker.yaml (100%) rename {studio => charts/studio}/templates/hpa-studio-backend.yaml (100%) rename {studio => charts/studio}/templates/hpa-studio-beat.yaml (100%) rename {studio => charts/studio}/templates/hpa-studio-ui.yaml (100%) rename {studio => charts/studio}/templates/hpa-studio-worker.yaml (100%) rename {studio => charts/studio}/templates/ingress-backend.yaml (100%) rename {studio => charts/studio}/templates/ingress-ui.yaml (100%) rename {studio => charts/studio}/templates/secrets.yaml (100%) rename {studio => charts/studio}/templates/service-backend.yaml (100%) rename {studio => charts/studio}/templates/service-ui.yaml (100%) rename {studio => charts/studio}/templates/serviceaccount.yaml (100%) rename {studio => charts/studio}/templates/tests/test-connection.yaml (100%) rename {studio => charts/studio}/values.yaml (100%) diff --git a/.github/workflows/helm.yaml b/.github/workflows/helm.yaml new file mode 100644 index 00000000..9a28c5ba --- /dev/null +++ b/.github/workflows/helm.yaml @@ -0,0 +1,75 @@ +name: Helm + +on: + push: + branches: + - main + +permissions: + contents: read + +jobs: + changes: + name: Check for updated charts + permissions: + contents: read + pull-requests: read + runs-on: ubuntu-latest + if: | + (github.repository == 'iterative/helm-charts') + outputs: + charts: ${{ steps.filter.outputs.charts }} + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: dorny/paths-filter@v2.11.1 + id: filter + with: + token: ${{ secrets.GITHUB_TOKEN }} + filters: | + charts: + - 'charts/studio/Chart.yaml' + - 'charts/studio/values.yaml' + + release: + name: Release chart + runs-on: ubuntu-latest + + permissions: + contents: write + + needs: + - changes + if: | + (github.repository == 'iterative/helm-charts') && + (needs.changes.outputs.charts == 'true') + + 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 + with: + version: v3.10.0 + + - name: Add repositories for dependencies + run: | + 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 + uses: helm/chart-releaser-action@v1.4.1 + env: + CR_SKIP_EXISTING: "false" + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/studio/.helmignore b/charts/studio/.helmignore similarity index 100% rename from studio/.helmignore rename to charts/studio/.helmignore diff --git a/studio/Chart.lock b/charts/studio/Chart.lock similarity index 67% rename from studio/Chart.lock rename to charts/studio/Chart.lock index c81ec46a..4dc0eb34 100644 --- a/studio/Chart.lock +++ b/charts/studio/Chart.lock @@ -8,5 +8,5 @@ dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami version: 11.9.1 -digest: sha256:993e49ca732a78b7374b17e8e5da57a05ccc181323ca6328d2f4a4c09a738f82 -generated: "2022-09-29T12:13:58.346288+05:30" +digest: sha256:1b3c189c2679d25a9a1f3586d8114e7562f1466f25b096371a51750f917c0c9e +generated: "2022-11-24T14:40:37.666315452+01:00" diff --git a/studio/Chart.yaml b/charts/studio/Chart.yaml similarity index 100% rename from studio/Chart.yaml rename to charts/studio/Chart.yaml diff --git a/studio/templates/NOTES.txt b/charts/studio/templates/NOTES.txt similarity index 100% rename from studio/templates/NOTES.txt rename to charts/studio/templates/NOTES.txt diff --git a/studio/templates/_env_vars.tpl b/charts/studio/templates/_env_vars.tpl similarity index 100% rename from studio/templates/_env_vars.tpl rename to charts/studio/templates/_env_vars.tpl diff --git a/studio/templates/_helpers.tpl b/charts/studio/templates/_helpers.tpl similarity index 100% rename from studio/templates/_helpers.tpl rename to charts/studio/templates/_helpers.tpl diff --git a/studio/templates/configmap.yaml b/charts/studio/templates/configmap.yaml similarity index 100% rename from studio/templates/configmap.yaml rename to charts/studio/templates/configmap.yaml diff --git a/studio/templates/deployment-studio-backend.yaml b/charts/studio/templates/deployment-studio-backend.yaml similarity index 100% rename from studio/templates/deployment-studio-backend.yaml rename to charts/studio/templates/deployment-studio-backend.yaml diff --git a/studio/templates/deployment-studio-beat.yaml b/charts/studio/templates/deployment-studio-beat.yaml similarity index 100% rename from studio/templates/deployment-studio-beat.yaml rename to charts/studio/templates/deployment-studio-beat.yaml diff --git a/studio/templates/deployment-studio-ui.yaml b/charts/studio/templates/deployment-studio-ui.yaml similarity index 100% rename from studio/templates/deployment-studio-ui.yaml rename to charts/studio/templates/deployment-studio-ui.yaml diff --git a/studio/templates/deployment-studio-worker.yaml b/charts/studio/templates/deployment-studio-worker.yaml similarity index 100% rename from studio/templates/deployment-studio-worker.yaml rename to charts/studio/templates/deployment-studio-worker.yaml diff --git a/studio/templates/hpa-studio-backend.yaml b/charts/studio/templates/hpa-studio-backend.yaml similarity index 100% rename from studio/templates/hpa-studio-backend.yaml rename to charts/studio/templates/hpa-studio-backend.yaml diff --git a/studio/templates/hpa-studio-beat.yaml b/charts/studio/templates/hpa-studio-beat.yaml similarity index 100% rename from studio/templates/hpa-studio-beat.yaml rename to charts/studio/templates/hpa-studio-beat.yaml diff --git a/studio/templates/hpa-studio-ui.yaml b/charts/studio/templates/hpa-studio-ui.yaml similarity index 100% rename from studio/templates/hpa-studio-ui.yaml rename to charts/studio/templates/hpa-studio-ui.yaml diff --git a/studio/templates/hpa-studio-worker.yaml b/charts/studio/templates/hpa-studio-worker.yaml similarity index 100% rename from studio/templates/hpa-studio-worker.yaml rename to charts/studio/templates/hpa-studio-worker.yaml diff --git a/studio/templates/ingress-backend.yaml b/charts/studio/templates/ingress-backend.yaml similarity index 100% rename from studio/templates/ingress-backend.yaml rename to charts/studio/templates/ingress-backend.yaml diff --git a/studio/templates/ingress-ui.yaml b/charts/studio/templates/ingress-ui.yaml similarity index 100% rename from studio/templates/ingress-ui.yaml rename to charts/studio/templates/ingress-ui.yaml diff --git a/studio/templates/secrets.yaml b/charts/studio/templates/secrets.yaml similarity index 100% rename from studio/templates/secrets.yaml rename to charts/studio/templates/secrets.yaml diff --git a/studio/templates/service-backend.yaml b/charts/studio/templates/service-backend.yaml similarity index 100% rename from studio/templates/service-backend.yaml rename to charts/studio/templates/service-backend.yaml diff --git a/studio/templates/service-ui.yaml b/charts/studio/templates/service-ui.yaml similarity index 100% rename from studio/templates/service-ui.yaml rename to charts/studio/templates/service-ui.yaml diff --git a/studio/templates/serviceaccount.yaml b/charts/studio/templates/serviceaccount.yaml similarity index 100% rename from studio/templates/serviceaccount.yaml rename to charts/studio/templates/serviceaccount.yaml diff --git a/studio/templates/tests/test-connection.yaml b/charts/studio/templates/tests/test-connection.yaml similarity index 100% rename from studio/templates/tests/test-connection.yaml rename to charts/studio/templates/tests/test-connection.yaml diff --git a/studio/values.yaml b/charts/studio/values.yaml similarity index 100% rename from studio/values.yaml rename to charts/studio/values.yaml