From 1fe8a31f29f7f57a84b6c41d7a7c52345005ca50 Mon Sep 17 00:00:00 2001 From: Benjamin Affolter <5555767+bliemli@users.noreply.github.com> Date: Thu, 13 Apr 2023 12:25:19 +0200 Subject: [PATCH] Add workflows for automatic charts release --- .github/workflows/lint-test.yaml | 36 +++++++++++++++++++++++++++ .github/workflows/release-charts.yaml | 27 ++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/workflows/lint-test.yaml create mode 100644 .github/workflows/release-charts.yaml diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml new file mode 100644 index 0000000..5129f07 --- /dev/null +++ b/.github/workflows/lint-test.yaml @@ -0,0 +1,36 @@ +name: Lint and test charts + +on: + pull_request: + +jobs: + lint-test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.4.0 + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }}) + if [[ -n "$changed" ]]; then + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch ${{ github.event.repository.default_branch }} + + - name: Create kind cluster + if: steps.list-changed.outputs.changed == 'true' + uses: helm/kind-action@v1.4.0 + + - name: Run chart-testing (install) + if: steps.list-changed.outputs.changed == 'true' + run: ct install --target-branch ${{ github.event.repository.default_branch }} diff --git a/.github/workflows/release-charts.yaml b/.github/workflows/release-charts.yaml new file mode 100644 index 0000000..f9f8ee8 --- /dev/null +++ b/.github/workflows/release-charts.yaml @@ -0,0 +1,27 @@ +name: Release charts + +on: + push: + branches: + - main + +jobs: + release: + 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: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"