feat: auto helm-doc and update node-red (#308) #94
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: chart-publish | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "charts/**" | |
- "!charts/**/README.md" | |
env: | |
HELM_DOCS_VERSION: "1.12.0" | |
permissions: read-all | |
jobs: | |
publish: | |
permissions: | |
contents: write # for helm/chart-releaser-action to push chart release and create a release | |
packages: write # for helm/chart-releaser-action to push chart release and create a release | |
id-token: write # for helm/chart-releaser-action to push chart release and create a release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Install Helm | |
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "[email protected]" | |
- name: install helm-docs | |
run: | | |
cd /tmp | |
wget https://github.com/norwoodj/helm-docs/releases/download/v${{env.HELM_DOCS_VERSION}}/helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz | |
tar -xvf helm-docs_${{env.HELM_DOCS_VERSION}}_Linux_x86_64.tar.gz | |
sudo mv helm-docs /usr/local/sbin | |
- name: run helm-docs | |
run: | | |
helm-docs -t README.md.gotmpl -o README.md -b for-the-badge | |
- name: Login to GHCR | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${ GITHUB_REPOSITORY_OWNER } | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run Artifact Hub lint | |
run: | | |
curl -s https://api.github.com/repos/artifacthub/hub/releases/latest | grep -E 'browser_download_url' | grep linux_amd64.tar.gz\" | grep -Eo 'https://[^\"]*' | xargs wget -O - | tar -xz | |
./ah lint -p charts/node-red || exit 1 | |
rm -f ./ah | |
- name: Run chart-releaser | |
uses: helm/chart-releaser-action@a917fd15b20e8b64b94d9158ad54cd6345335584 # v1.6.0 | |
with: | |
config: "./.github/configs/cr.yaml" | |
env: | |
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 # v3.3.0 | |
- name: Push chart to GHCR | |
env: | |
COSIGN_EXPERIMENTAL: 1 | |
run: | | |
shopt -s nullglob | |
for pkg in .cr-release-packages/*; do | |
if [ -z "${pkg:-}" ]; then | |
break | |
fi | |
helm push "${pkg}" oci://ghcr.io/schwarzit/charts |& tee .digest | |
cosign sign -y $(cat .digest | awk -F "[, ]+" '/Pushed/{print $NF}') | |
done |