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

Support packaging and pushing a specified chart only #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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.

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.

None yet

1 participant