Skip to content

Support packaging and pushing a specified chart only#36

Open
superbrothers wants to merge 1 commit intostefanprodan:masterfrom
superbrothers:chart_dir
Open

Support packaging and pushing a specified chart only#36
superbrothers wants to merge 1 commit intostefanprodan:masterfrom
superbrothers:chart_dir

Conversation

@superbrothers
Copy link

@superbrothers superbrothers commented Dec 10, 2022

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}}

@superbrothers
Copy link
Author

@stefanprodan Please review this PR.

Signed-off-by: Kazuki Suda <kazuki.suda@gmail.com>
@ddfreiling
Copy link

This would be nice to have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants