Giter Club home page Giter Club logo

helm-gh-pages's Introduction

Helm Publisher

A GitHub Action for publishing Helm charts with Github Pages.

Usage

Inputs:

  • token The GitHub token with write access to the target repository
  • charts_dir The charts directory, defaults to charts
  • charts_url The GitHub Pages URL, defaults to https://<OWNER>.github.io/<REPOSITORY>
  • owner The GitHub user or org that owns this repository, defaults to the owner in GITHUB_REPOSITORY env var
  • repository The GitHub repository, defaults to the GITHUB_REPOSITORY env var
  • branch The branch to publish charts, defaults to gh-pages
  • target_dir The target directory to store the charts, defaults to .
  • helm_version The Helm CLI version, defaults to the latest release
  • linting Toggle Helm linting, can be disabled by setting it to off
  • commit_username Explicitly specify username for commit back, default to GITHUB_ACTOR
  • commit_email Explicitly specify email for commit back, default to [email protected]
  • app_version Explicitly specify app version in package. If not defined then used chart values.
  • chart_version Explicitly specify chart version in package. If not defined then used chart values.
  • index_dir The location of index.yaml file in the repo, defaults to the same value as target_dir
  • enterprise_url The URL of enterprise github server in the format <server-url>/<organisation>
  • dependencies A list of helm repositories required to verify dependencies in the format <name>,<url>;<name>,<url> or if using private repositories <name>,<username>,<password>,<url>;<name>,<username>,<password>,<url>. Combinations are allowed.

Examples

Package and push all charts in ./charts dir to gh-pages branch:

name: release
on:
  push:
    tags: '*'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Publish Helm charts
        uses: stefanprodan/helm-gh-pages@master
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

Package and push charts in ./chart dir to gh-pages branch in a different repository:

name: release-chart
on:
  push:
    tags: 'chart-*'

jobs:
  release-chart:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Publish Helm chart
        uses: stefanprodan/helm-gh-pages@master
        with:
          token: ${{ secrets.BOT_GITHUB_TOKEN }}
          charts_dir: chart
          charts_url: https://charts.fluxcd.io
          owner: fluxcd
          repository: charts
          branch: gh-pages
          target_dir: charts
          commit_username: johndoe
          commit_email: [email protected]

Package chart with specified chart & app versions and push all charts in ./charts dir to gh-pages branch:

name: release
on:
  push:
    tags: '*'

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Publish Helm charts
        uses: stefanprodan/helm-gh-pages@master
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          app_version: 1.16.0
          chart_version: 0.1.0

helm-gh-pages's People

Contributors

ahmedwaleedmalik avatar aslafy-z avatar clenimar avatar josedev-union avatar paulcarlton-ww avatar rohilsurana avatar stefanprodan avatar steven-sheehy avatar t3mi avatar wojcikmm avatar zzorica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

helm-gh-pages's Issues

Fail to publish charts with dependencies stored on the same repository (when private)

Hello,

I use helm-gh-pages to store my Helm charts in a private Github repository.
I discovered that when one tries to publish a chart that depends on a subchart present on the same private repository, the action fails with a 404 error.

In particular, I've developed chartB and published it successfully via helm-gh-pages on my private repo.
I've also developed an umbrella chart (called chartA) that depends on chartB. During publishing of chartA, helm-gh-pages fails with the following error:

Found chart directory charts/chartB
Found chart directory charts/chartA
Getting updates for unmanaged Helm repositories...
Error: no cached repository for helm-manager-zzzzzzzzzzzzzzzzzzzzzz found. (try 'helm repo update'): open /github/home/.cache/helm/repository/helm-manager-zzzzzzzzzzzzzzzzzzzzzz-index.yaml: no such file or directory
...Unable to get an update from the "https://raw.githubusercontent.com/my/helm-charts-repository/gh-pages" chart repository:
	failed to fetch https://raw.githubusercontent.com/my/helm-charts-repository/gh-pages : 404 Not Found

(URLs have been anonymised)

The root-cause of this is that helm doesn't have the Github private repository configured using helm repo add.
A workaround is adding the repo prior to fetching dependencies. For example.

helm repo add ${REPOSITORY} ${CHARTS_URL} --username ${GITHUB_TOKEN} --password ${GITHUB_TOKEN}

Thus, any charts that exist on the Github private repository would be accessible, if used by another chart. I understand that this functionality isn't always desirable. But it can easily toggled-on, when needed.

Skip files and non-chart folders

We have a folder in charts folder that is not a chart but is related to charts that this action fails on. We also have a README.md in the charts folder that causes it to fail. It would be nice if the action could skip files and directories that don't have a Chart.yaml.

Also, it should run helm dep up before lint since parent chart may use child values to render templates and fail if it doesn't have those charts downloaded yet.

Or linting should be optional, as we do it in a previous step anyway.

Error: 7 chart(s) linted, 3 chart(s) failed
==> Linting /github/workspace/charts/README.md
Error unable to check Chart.yaml file in chart: stat /github/workspace/charts/README.md/Chart.yaml: not a directory

==> Linting /github/workspace/charts/hedera-mirror

==> Linting /github/workspace/charts/hedera-mirror-common
[ERROR] templates/: template: hedera-mirror-common/templates/NOTES.txt:8:45: executing "hedera-mirror-common/templates/NOTES.txt" at <.Values.traefik.ports.web.exposedPort>: nil pointer evaluating interface {}.exposedPort

==> Linting /github/workspace/charts/hedera-mirror-grpc

==> Linting /github/workspace/charts/hedera-mirror-importer

==> Linting /github/workspace/charts/hedera-mirror-rest

==> Linting /github/workspace/charts/marketplace
Error unable to check Chart.yaml file in chart: stat /github/workspace/charts/marketplace/Chart.yaml: no such file or directory

Adding option directory publish

Hi

I have a two directory charts and hosting, the charts store helm template and hosting store chart publish, bellow my command line

$ cd hosting
$ helm package ../private/<chart-name>
helm repo index . --merge index.yaml

Do we have a option to support directory publish

user specified "charts_dir" argument doesnt work with the Action

I have multiple charts in my repo. I am setting up workflow to run it for specific chart i.e. charts/common
I am passing my charts dir path to Github action as below:

- name: Publish Helm charts
        uses: stefanprodan/helm-gh-pages@master
        with:
          charts_dir: charts/common
          token: ${{ secrets.GITHUB_TOKEN }}

however workflow fails while executing the action with below error. Not sure why cant it locate Chart.yaml in the charts dir "charts/common" even though its present there.

Screenshot 2021-02-03 152956

Screenshot 2021-02-03 152737

Run stefanprodan/helm-gh-pages@master
/usr/bin/docker run --name fff47541574080a7dd09b76af1afed_ae0358 --label 442333 --workdir /github/workspace --rm -e INPUT_CHARTS_DIR -e INPUT_TOKEN -e INPUT_CHARTS_URL -e INPUT_OWNER -e INPUT_REPOSITORY -e INPUT_BRANCH -e INPUT_TARGET_DIR -e INPUT_HELM_VERSION -e INPUT_LINTING -e INPUT_COMMIT_USERNAME -e INPUT_COMMIT_EMAIL -e INPUT_APP_VERSION -e INPUT_CHART_VERSION -e HOME -e GITHUB_JOB -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_RETENTION_DAYS -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_SERVER_URL -e GITHUB_API_URL -e GITHUB_GRAPHQL_URL -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e GITHUB_ACTION_REPOSITORY -e GITHUB_ACTION_REF -e GITHUB_PATH -e GITHUB_ENV -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e ACTIONS_CACHE_URL -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/bb-helmcharts/bb-helmcharts":"/github/workspace" 442333:12fff47541574080a7dd09b76af1afed "" "charts/common" "" "" "" "" "" "" "" "" "*****@users.noreply.github.com" "" ""
Ignoring non-chart directory charts/common/templates
Error: 1 chart(s) linted, 1 chart(s) failed
==> Linting .
Error unable to check Chart.yaml file in chart: stat Chart.yaml: no such file or directory

Support storing charts in sub-folder

We want to use GitHub Pages to store both documentation and charts. We'd like store them both in sub-folders so that users can go to either http://<owner>.github.io/<repository>/charts and http://<owner>.github.io/<repository>/docs depending upon their need. Currently the action assumes the charts will be in the top level folder.

Root directory chart

Does this action support packaging charts that are at the root of the directory? I'm currently seeing Error: need at least one argument, the path to the chart whenever I set charts_dir: .

Case for Github page using main branch /docs folder

Error: failed to fetch https://${OWNER}.github.io/${REPOSITORY}/docs/xxx-yyy.tgz : 404 Not Found

Github page created using main branch /docs folder so set TARGET_DIR as docs. Then such error occurred.

The CHARTS_URL is defined as https://${OWNER}.github.io/${REPOSITORY}/${TARGET_DIR}.
Seems need to filter the docs case so not add docs to the CHARTS_URL.

Thoughts on replacing already published charts

Hi,

I'm comparing this to https://github.com/helm/chart-releaser-action and besides using github releases, one major difference is that this logic will replace an already published chart ( git add ${TARGET_DIR}) while the other will not change an existing release. I think not changing an existing release is the right thing to do with helm. Do you want to replicate this behavior here as well? If not, I'm curious why.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.