Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PM-1506 Helm Docs workflow #188

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/docs/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

## Prerequisites

Before using this Helm chart, you should have the following prerequisites:

- Access to Kubernetes cluster (If needed contact your friendly neighbourhood DevOps engineer)
- Helm >= v3.14.3
- (**Optional**) helmfile >= v0.162.0 to install this chart

## Installation

> Note: **examples** can be found in the repository

To install this Helm chart, the easiest is to create a helmfile.yaml with needed values and run:

```
helmfile template
helmfile apply
```

Or use helmfile only to generate resources and apply them with kubectl like so:

```
helmfile template | kubectl -f -
```

Verify that the chart is deployed successfully:

> Note: `kubectl` is a better suited tool for this

```
helmfile status
```

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
38 changes: 38 additions & 0 deletions .github/workflows/helm-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
pull_request:
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: true

jobs:

get-changed-chart-dir:
name: 🗂️ Get Helm Chart Changes
uses: MinaFoundation/workflows/.github/workflows/get-changed-directories-workflow.yaml@main
with:
pattern: '^.*/.*yaml$'


helm-docs:
runs-on: minafoundation-default-runners
strategy:
matrix:
directories: ${{ fromJson(needs.get-changed-chart-dir.outputs.changed_dir_list) }}

steps:
- name: Is changed dir Helm Chart
id: is-helm-chart
env:
CHART_DIR: ${{ matrix.directories }}
run: |
cd $CHART_DIR
if [[ -r Chart.yaml ]]; then
echo "is-helm-chart=true" >> $GITHUB_OUTPUT
else
echo "is-helm-chart=false" >> $GITHUB_OUTPUT
fi
- name: Generate README with helm-docs
uses: MinaFoundation/workflows/.github/workflows/helm-docs.yaml@PM-1506-helm-docs-workflow #test branch change to main when merged
if: steps.is-helm-chart.outputs.is-helm-chart == 'true'
with:
branch: ${{ github.ref_name }}
directory: ${{ matrix.directories }}