Code Monkey home page Code Monkey logo

helm-gh-pages-1's Introduction

Helm Charts on GitHub Pages (gh-pages)

GitHub Action that publishes Helm charts to a Helm repository hosted on GitHub Pages.

Usage - Basic

This GitHub Action will package your Helm charts and deploy them to GitHub Pages for you! Here's a basic workflow example:

name: Helm Publish

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: dellintosh/helm-gh-pages@master
        with:
          chart_path: charts/my-app
          gh_pages_URL: https://octocat.github.io/charts
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  • chart_path (required): Path to the application chart you wish to publish.
  • gh_pages_URL (required): URL pointing to the output gh-pages site.
  • tag_filter (optional): Git tag filter
  • GITHUB_TOKEN (required): Environment Variable pulled from secrets. This is used to publish Helm chart assets to the gh-pages branch.

In order to use this action your Git repository should have a gh-pages branch created.

Filter by git tag

Publish the Helm chart located at charts/my-app when the Git tag contains the chart- prefix:

...
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: dellintosh/helm-gh-pages@master
        with:
          chart_path: charts/my-app
          gh_pages_URL: https://octocat.github.io/charts
          tag_filter: chart-
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How it Works

Assuming your GitHub repository has a Helm chart named app located at chart/app the release procedure could be:

# make changes to the chart/app and bump the version inside Chart.yaml
$ git commit -m "Bump chart version to 1.0.0"
$ git push origin master

# release v1.0.0
$ git tag v1.0.0
$ git push origin v1.0.0

When you push the tag, GitHub will start the workflow and the helm-gh-pages will do the following:

  • check out the v1.0.0 tag
  • validate the chart by running Helm lint
  • package the chart to /github/home/pkg/app-1.0.0.tgz
  • check out the gh-pages branch
  • copy the app-1.0.0.tgz from /github/home to /github/workspace
  • update the Helm repository index using the GitHub pages URL
  • commit the chart package and the Helm repository index
  • push the changes to gh-pages using the GITHUB_TOKEN secret

In couple of seconds GitHub will publish the change to GitHub Pages and your chart v1.0.0 will be available for download.

Credits

This GitHub Action is a modified version of stefanprodan original gh-actions/helm-gh-pages Action. Sadly, his version was not updated when GitHub released Actions v2, so I modified it to work with the v2 release.

helm-gh-pages-1's People

Contributors

dellintosh avatar

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.