From 37b6916020162ceac7b7c6ba222c5be8f453c11a Mon Sep 17 00:00:00 2001 From: Luke Carrier Date: Thu, 15 Oct 2020 18:39:12 +0100 Subject: [PATCH 1/3] Helm chart releaser workflow Use the Helm Chart Releaser GitHub Action to release charts to a branch served by GitHub Pages. --- .github/workflows/helm.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/helm.yml diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml new file mode 100644 index 000000000..3d9afb9c8 --- /dev/null +++ b/.github/workflows/helm.yml @@ -0,0 +1,22 @@ +name: Helm + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + steps: + - 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: Release + uses: helm/chart-releaser-action@v1.0.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" From 7162c48576d36f8f511941f0cfa04954ed57c412 Mon Sep 17 00:00:00 2001 From: Sergio Ballesteros Date: Thu, 13 Jan 2022 11:43:22 +0100 Subject: [PATCH 2/3] Configure Helm release/CI workflow --- .github/workflows/ci.yaml | 18 +++++++++++++++- .github/workflows/helm.yml | 35 ++++++++++++++++++++------------ README.md | 4 +++- charts/chart-release-config.yaml | 1 + charts/redisoperator/Chart.yaml | 1 - 5 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 charts/chart-release-config.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c208352aa..7d5282372 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: check: - name: Check + name: Golang Check runs-on: ubuntu-latest # Execute the checks inside the container instead the VM. container: golangci/golangci-lint:v1.43.0-alpine @@ -39,3 +39,19 @@ jobs: - name: Add redisfailover CRD run: kubectl apply -f manifests/databases.spotahome.com_redisfailovers.yaml - run: make ci-integration-test + + chart-test: + name: Chart testing + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v1 + with: + version: v3.7.2 + + - name: Helm test + run: make helm-test diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml index 3d9afb9c8..b388ecc26 100644 --- a/.github/workflows/helm.yml +++ b/.github/workflows/helm.yml @@ -1,22 +1,31 @@ -name: Helm +name: Release Charts on: push: branches: - - master + - master jobs: release: runs-on: ubuntu-latest steps: - - 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: Release - uses: helm/chart-releaser-action@v1.0.0 - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - 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 + with: + version: v3.7.2 + + - name: Release + uses: helm/chart-releaser-action@v1.2.1 + with: + charts_dir: charts + config: charts/chart-release-config.yaml + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/README.md b/README.md index 076790a96..a606a1987 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,9 @@ This will create a deployment named `redisoperator`. From the root folder of the project, execute the following: ``` -helm install --name redisfailover charts/redisoperator +helm repo add redis-operator https://spotahome.github.io/redis-operator +helm repo update +helm install redis-operator redis-operator/redis-operator ``` ## Usage diff --git a/charts/chart-release-config.yaml b/charts/chart-release-config.yaml new file mode 100644 index 000000000..85a825a68 --- /dev/null +++ b/charts/chart-release-config.yaml @@ -0,0 +1 @@ +release-name-template: Chart-{{ .Version }} diff --git a/charts/redisoperator/Chart.yaml b/charts/redisoperator/Chart.yaml index de69cfc72..e25678f5d 100644 --- a/charts/redisoperator/Chart.yaml +++ b/charts/redisoperator/Chart.yaml @@ -5,7 +5,6 @@ apiVersion: v1 description: A Helm chart for the Spotahome Redis Operator name: redis-operator version: 3.1.2 -engine: gotpl home: https://github.com/spotahome/redis-operator keywords: - "golang" From c879dbb6f36759d68aaa9080abe93ba30f0ab30f Mon Sep 17 00:00:00 2001 From: Sergio Ballesteros Date: Thu, 13 Jan 2022 13:20:58 +0100 Subject: [PATCH 3/3] Run CI on PRs or master --- .github/workflows/ci.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7d5282372..66db6881d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,10 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: jobs: check: