Skip to content

Commit

Permalink
PM-1506 Helm Docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Smorci committed Apr 18, 2024
1 parent a23fd5b commit 87b8354
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
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 }}

0 comments on commit 87b8354

Please sign in to comment.