diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c208352aa..66db6881d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,10 +1,14 @@ name: CI -on: [push, pull_request] +on: + push: + branches: + - main + 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 +43,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 new file mode 100644 index 000000000..b388ecc26 --- /dev/null +++ b/.github/workflows/helm.yml @@ -0,0 +1,31 @@ +name: Release Charts + +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: 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"