Skip to content

SamhammerAG/helm-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helm Action

Contains multiple github actions for helm 3

Helm Action Build

Package chart with version and publish to an OCI-based (Docker) registry.
See full parameter documentation at build/action.yml

Usage

    steps:
    - uses: actions/checkout@v3
    - uses: azure/setup-helm@v3
      with:
        version: 'v3.12.3'
    - uses: SamhammerAG/helm-action/build@v2.0.0
      with:
        registry: ${{ secrets.DOCKER_REGISTRY }}
        registry_user: ${{ secrets.DOCKER_REGISTRY_USER }}
        registry_password: ${{ secrets.DOCKER_REGISTRY_PW }}
        registry_path: charts/my-chart
        chart_folder: ./my-chart
        chart_version: 1.0 #optional
        app_version: 1.0
        chart_annotations: company 'samhammer ag' #optional

Action inputs

Name Description Required Default
registry OCI registry true
registry_user OCI registry username true
registry_password OCI registry password true
registry_path Chart registry path true
chart_version Chart version (only optional, when defined in Chart.yaml) false
app_version App version (will be tagged and updated in Chart.yaml) true
chart_folder Chart folder true
chart_annotations Chart annotations that should be added (e.g. company 'samhammer ag' author 'alwin schiffman') false

Action outputs

Name Description
image Chart image (Default '{registry}/{registry_path}/{chart_name}:{chart_version}')

Helm Action Deploy

Deploy chart from an OCI-based (Docker) registry.
See full parameter documentation at deploy/action.yml

Usage

    steps:
    - uses: actions/checkout@v3
    - uses: azure/setup-helm@v3
      with:
        version: 'v3.12.3'
    - uses: SamhammerAG/helm-action/deploy@v2.0.0
      with:
        registry: ${{ secrets.DOCKER_REGISTRY }}
        registry_user: ${{ secrets.DOCKER_REGISTRY_USER }}
        registry_password: ${{ secrets.DOCKER_REGISTRY_PW }}
        registry_path: charts
        chart_name: my-chart
        app_version: 1.0
        namespace: my-namespace
        release_name: my-release
        values_file: ./my-chart/values.yaml #optional
        set_string: test=1 #optional
        additional_flags: --wait #optional

Action inputs

Name Description Required Default
registry OCI registry true
registry_user OCI registry username true
registry_password OCI registry password true
registry_path Chart registry path true
app_version The app version tag true
release_name Helm release name true
release_name_max_length Helm release name chars before cut (defaults to 53, deactivate with 0) false 53
namespace Kubernetes namespace true
values_file Values file that must exist (for multiple files use comma as delimiter) false
optional_values_file Optional values file (for multiple files use comma as delimiter) false
set_string Single string parameter false
kube_config Kubernetes custom config false
additional_flags Additional flat flags false

Action outputs

Name Description
actual_release_name The actual relese name that is used for installation (shortened if max length reached)

Helm Action Uninstall

Uninstall helm releases, by matching release name.
See full parameter documentation at uninstall/action.yml

Usage (simple)

    steps:
    - uses: azure/setup-helm@v3
      with:
        version: 'v3.12.3'
    - uses: SamhammerAG/helm-action/uninstall@v2.0.0
      with:
        namespace: my-namespace
        release_filter: ^my-release$ #regex filter

Usage (with branch filter)

When you have deploy releases for feature branches you may set "branch" value (set-string/values-file) for this releases. Then you can delete that release when your branch is merged/deleted. The "branch" Helm release parameter can be changed through the "branch_helm_property" setting of the action.

    steps:
    - uses: azure/setup-helm@v3
      with:
        version: 'v3.12.3'
    - run: echo "branch=${GITHUB_REF##*/}" | tr '[:upper:]' '[:lower:]' >> $GITHUB_OUTPUT
      id: version
    - uses: SamhammerAG/helm-action/uninstall@v2.0.0
      with:
        namespace: my-namespace
        release_filter: ^my-release$ #regex filter
        branch_filter: ${{ steps.version.outputs.branch }}

Action inputs

Name Description Required Default
release_filter Helm release name (regular expression e.g. ^my-relase$). Lookaheads are supported. true
branch_filter Branch name false
branch_helm_property Property-Path in Helm-Release JSON for branch detection. (JQ format) false .branch
namespace Kubernetes namespace true
kube_config Kubernetes custom config false
additional_flags Additional flat flags (e.g. --dry-run) false
max_age_in_days All releases older than given day-count would be marked for deletion. false

License

This project is distributed under the MIT license.

About

Github Actions for Helm

Topics

Resources

License

Stars

0 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors