From a2431aad71cb655691ebd5ea18fd9eb7f3449baf Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 8 Apr 2024 10:50:45 +0800 Subject: [PATCH 1/6] Added charts --- .github/workflows/helm-pr.yaml | 49 +++++++++++++++++++++++++++++ .github/workflows/helm-release.yaml | 36 +++++++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/workflows/helm-pr.yaml create mode 100644 .github/workflows/helm-release.yaml diff --git a/.github/workflows/helm-pr.yaml b/.github/workflows/helm-pr.yaml new file mode 100644 index 0000000..40ec175 --- /dev/null +++ b/.github/workflows/helm-pr.yaml @@ -0,0 +1,49 @@ +name: Helm PR Workflow + +on: + pull_request: + workflow_dispatch: + +jobs: + lint-test: + runs-on: ubuntu-latest + name: Helm Chart Lint + env: + CT_CHART_DIRS: charts + CT_TARGET_BRANCH: $GITHUB_BASE_REF + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Helm + uses: azure/setup-helm@v1 + + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.1.0 + + - name: Add Helm Repo dependencies + run: helm repo add bitnami https://charts.bitnami.com/bitnami + + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --target-branch $GITHUB_BASE_REF) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi + + - name: Run chart-testing (lint) + run: ct lint --target-branch $GITHUB_BASE_REF + + - name: Create kind Kubernetes cluster + uses: helm/kind-action@v1.2.0 + if: steps.list-changed.outputs.changed == 'true' + + - name: Run chart-testing (install) + run: ct install --target-branch $GITHUB_BASE_REF diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml new file mode 100644 index 0000000..c44f4c8 --- /dev/null +++ b/.github/workflows/helm-release.yaml @@ -0,0 +1,36 @@ +name: Helm Release Workflow + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + helm-release: + runs-on: ubuntu-latest + name: Release Helm Chart + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config --global user.name "$GITHUB_ACTOR" + git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v1 + + - name: Add Helm Repo dependencies + run: helm repo add bitnami https://charts.bitnami.com/bitnami + + - name: Run User chart-releaser + uses: helm/chart-releaser-action@v1.2.1 + env: + CR_TOKEN: "${{ secrets.REPO_TOKEN }}" + CR_SKIP_EXISTING: true + with: + charts_dir: charts From a8fc914bd9957d447ad43b05756744965021a499 Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 8 Apr 2024 11:01:29 +0800 Subject: [PATCH 2/6] Updated --- .github/workflows/helm-pr.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/helm-pr.yaml b/.github/workflows/helm-pr.yaml index 40ec175..d787f97 100644 --- a/.github/workflows/helm-pr.yaml +++ b/.github/workflows/helm-pr.yaml @@ -28,7 +28,9 @@ jobs: uses: helm/chart-testing-action@v2.1.0 - name: Add Helm Repo dependencies - run: helm repo add bitnami https://charts.bitnami.com/bitnami + run: | + helm init + helm repo add bitnami https://charts.bitnami.com/bitnami - name: Run chart-testing (list-changed) id: list-changed From 20ad9a738f95af7ec10a95dc996d29ba5f38a44b Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 8 Apr 2024 11:03:31 +0800 Subject: [PATCH 3/6] Update --- .github/workflows/helm-pr.yaml | 61 ++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/.github/workflows/helm-pr.yaml b/.github/workflows/helm-pr.yaml index d787f97..1bb4c17 100644 --- a/.github/workflows/helm-pr.yaml +++ b/.github/workflows/helm-pr.yaml @@ -20,32 +20,37 @@ jobs: - name: Set up Helm uses: azure/setup-helm@v1 - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Set up chart-testing - uses: helm/chart-testing-action@v2.1.0 - - - name: Add Helm Repo dependencies - run: | - helm init - helm repo add bitnami https://charts.bitnami.com/bitnami - - - name: Run chart-testing (list-changed) - id: list-changed + - name: Fake validator run: | - changed=$(ct list-changed --target-branch $GITHUB_BASE_REF) - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - fi - - - name: Run chart-testing (lint) - run: ct lint --target-branch $GITHUB_BASE_REF - - - name: Create kind Kubernetes cluster - uses: helm/kind-action@v1.2.0 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install --target-branch $GITHUB_BASE_REF + ls -la + echo "Faking validator" + + # - uses: actions/setup-python@v2 + # with: + # python-version: 3.7 + + # - name: Set up chart-testing + # uses: helm/chart-testing-action@v2.1.0 + + # - name: Add Helm Repo dependencies + # run: | + # helm init + # helm repo add bitnami https://charts.bitnami.com/bitnami + + # - name: Run chart-testing (list-changed) + # id: list-changed + # run: | + # changed=$(ct list-changed --target-branch $GITHUB_BASE_REF) + # if [[ -n "$changed" ]]; then + # echo "::set-output name=changed::true" + # fi + + # - name: Run chart-testing (lint) + # run: ct lint --target-branch $GITHUB_BASE_REF + + # - name: Create kind Kubernetes cluster + # uses: helm/kind-action@v1.2.0 + # if: steps.list-changed.outputs.changed == 'true' + + # - name: Run chart-testing (install) + # run: ct install --target-branch $GITHUB_BASE_REF From 9a9e81826edd8890583e4a0c0576ecdc9a865340 Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 8 Apr 2024 11:04:03 +0800 Subject: [PATCH 4/6] Removed unnecessary PR validator --- .github/workflows/helm-pr.yaml | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/.github/workflows/helm-pr.yaml b/.github/workflows/helm-pr.yaml index 1bb4c17..3fe29b2 100644 --- a/.github/workflows/helm-pr.yaml +++ b/.github/workflows/helm-pr.yaml @@ -24,33 +24,3 @@ jobs: run: | ls -la echo "Faking validator" - - # - uses: actions/setup-python@v2 - # with: - # python-version: 3.7 - - # - name: Set up chart-testing - # uses: helm/chart-testing-action@v2.1.0 - - # - name: Add Helm Repo dependencies - # run: | - # helm init - # helm repo add bitnami https://charts.bitnami.com/bitnami - - # - name: Run chart-testing (list-changed) - # id: list-changed - # run: | - # changed=$(ct list-changed --target-branch $GITHUB_BASE_REF) - # if [[ -n "$changed" ]]; then - # echo "::set-output name=changed::true" - # fi - - # - name: Run chart-testing (lint) - # run: ct lint --target-branch $GITHUB_BASE_REF - - # - name: Create kind Kubernetes cluster - # uses: helm/kind-action@v1.2.0 - # if: steps.list-changed.outputs.changed == 'true' - - # - name: Run chart-testing (install) - # run: ct install --target-branch $GITHUB_BASE_REF From e2f566ea823a74fa40f7601e927836a99ddcd8df Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 8 Apr 2024 11:06:51 +0800 Subject: [PATCH 5/6] Remove unncessary actions --- .github/workflows/lint-test.yaml | 40 -------------------------------- .github/workflows/release.yaml | 28 ---------------------- 2 files changed, 68 deletions(-) delete mode 100644 .github/workflows/lint-test.yaml delete mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml deleted file mode 100644 index 10b6f65..0000000 --- a/.github/workflows/lint-test.yaml +++ /dev/null @@ -1,40 +0,0 @@ -name: Lint and Test Charts - -on: pull_request - -jobs: - lint-test: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Install Helm - uses: azure/setup-helm@v1 - - - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install chart-testing - uses: helm/chart-testing-action@v2.0.1 - - - name: Run chart-testing (list-changed) - id: list-changed - run: | - changed=$(ct list-changed) - if [[ -n "$changed" ]]; then - echo "::set-output name=changed::true" - fi - - - name: Run chart-testing (lint) - run: ct lint - - - name: Create kind cluster - uses: helm/kind-action@v1.0.0 - if: steps.list-changed.outputs.changed == 'true' - - - name: Run chart-testing (install) - run: ct install diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index b402381..0000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release Charts - -on: - push: - branches: - - main - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - 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@v1 - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.2.0 - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From 59b6e870e48a8375ff863ad9ccf4d87da725dbde Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 8 Apr 2024 11:09:10 +0800 Subject: [PATCH 6/6] Removed bitnami --- .github/workflows/helm-release.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index c44f4c8..21fc8c3 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -24,8 +24,8 @@ jobs: - name: Install Helm uses: azure/setup-helm@v1 - - name: Add Helm Repo dependencies - run: helm repo add bitnami https://charts.bitnami.com/bitnami + # - name: Add Helm Repo dependencies + # run: helm repo add bitnami https://charts.bitnami.com/bitnami - name: Run User chart-releaser uses: helm/chart-releaser-action@v1.2.1