helm-gh-pages
helm-gh-pages copied to clipboard
Support packaging and pushing a specified chart only
This PR supports packaging and pushing a specified chart only.
I want to release a specified chart with a specified chartVersion in a repository containing multiple charts. For example, the workflow would be as follows.
name: Release Charts
on:
push:
tags: ["**"]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Get the chart name and version from the tag
uses: actions/github-script@v6
id: info
with:
script: |
const tag = process.env.GITHUB_REF_NAME
// The tag name is assumed to be `<chart name>-<chartVersion>`.
const matches = tag.match(/^(.+)-([0-9]+\.[0-9]+\.[0-9]+)$/)
console.log(matches)
core.setOutput('name', matches[1])
core.setOutput('version', matches[2])
- name: Checkout
uses: actions/checkout@v3
- name: Publish Helm chart
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
chart_dir: charts/${{steps.info.outputs.name}}
chart_version: ${{steps.info.outputs.version}}
@stefanprodan Please review this PR.