From 16bace3be38c99365a9b9669d04344e0de51f490 Mon Sep 17 00:00:00 2001 From: Ryosuke Date: Tue, 3 Oct 2023 05:29:42 +0900 Subject: [PATCH] feat: revive helm chart publishing This partially reverts cfdc53fd26b031b2a561531499995821add4d061. --- .github/workflows/release_helm_charts.yaml | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/release_helm_charts.yaml diff --git a/.github/workflows/release_helm_charts.yaml b/.github/workflows/release_helm_charts.yaml new file mode 100644 index 000000000..324af4bb1 --- /dev/null +++ b/.github/workflows/release_helm_charts.yaml @@ -0,0 +1,68 @@ +name: "Helm chart を更新・公開する" + +on: + push: + # Only when a helm-chart is updated + paths: + - ".github/workflows/release_helm_charts.yaml" + - "helm-charts/**" + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: v3.9.0 + + - uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - 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 main --chart-dirs helm-charts) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + if: steps.list-changed.outputs.changed == 'true' + run: ct lint --target-branch main --chart-dirs helm-charts + + release: + runs-on: ubuntu-latest + if: ${{ github.ref == 'refs/heads/main' }} + needs: ["lint"] + steps: + - name: Checkout + uses: actions/checkout@v4 + 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.9.0 + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.5.0 + with: + charts_dir: helm-charts + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"