From e30c473113cdbc1859e913e70d94130acd5f2f54 Mon Sep 17 00:00:00 2001 From: sd109 Date: Wed, 4 Sep 2024 10:23:07 +0100 Subject: [PATCH] Build and publish chart on any version bump --- .github/workflows/helm-build-push.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-build-push.yml b/.github/workflows/helm-build-push.yml index 5b8005246c7..c4ff888dd1b 100644 --- a/.github/workflows/helm-build-push.yml +++ b/.github/workflows/helm-build-push.yml @@ -3,16 +3,34 @@ name: Publish Danswer Helm Chart on: push: branches: - - main + - "*" workflow_dispatch: jobs: + check_for_helm_chart_version_change: + runs-on: ubuntu-latest + outputs: + version_changed: ${{ steps.version_check.outputs.chart_version_changed }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check for Helm chart version bump + id: version_check + run: | + changed=$(git diff HEAD~1 deployment/helm/Chart.yaml | grep --silent "^+version: " && echo true) + echo chart_version_changed=$changed >> $GITHUB_OUTPUTS + 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 + needs: check_for_helm_chart_version_change + if: ${{ needs.check_for_helm_chart_version_change.outputs.version_changed == 'true' }} steps: - name: Checkout uses: actions/checkout@v3