Skip to content

cloudbees-io/helm-push

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CloudBees action: Push a Helm chart

Use this action to upload, or publish, a packaged Helm chart into a repository. This action also reports artifact-related data to the workflow run for artifact traceability purposes.

Inputs

Table 1. Input details
Input name Data type Required? Description

chart

String

Yes

The path of the Helm chart package to be published.

remote

String

Yes

The URL of the published Helm chart package.

Outputs

Table 2. Output details
Output name Data type Description

artifact-id

String

The unique identifier of the artifact reported to the CloudBees platform.

chart

String

The image reference pointing to the chart upload location.

version

String

The version of the uploaded Helm chart package.

Usage examples

Use the Helm package action to package a Helm chart, and this action to publish it.

Basic example

The following is a basic example of using this action:

- name: Push Helm chart
      uses: cloudbees-io/helm-push@v1
      with:
        chart: ./charts/example
        remote: oci://registry.example.com/example

Full workflow and run example

The following workflow example packages and publishes a Helm chart to an AWS ECR registry, which is compatible with Open Container Initiative (OCI) standards. The workflow then verifies the output.

Example workflow YAML file
apiVersion: automation.cloudbees.io/v1alpha1
kind: workflow
name: test
on:
  push:
    branches:
      - '**'
jobs:
  test:
    permissions:
      scm-token-own: read
      id-token: write
    steps:
    - name: Get source code
      uses: cloudbees-io/checkout@v1
      with:
        repository: my-name/my-repo-name
    - name: Package the Helm chart
      id: package
      uses: cloudbees-io/helm-package@v1
      with:
        chart: my-name/my-repo-name/charts/example
        destination: ./chart-output
    - name: Login to AWS
      uses: https://github.com/cloudbees-io/configure-aws-credentials@v1
      with:
        aws-region: us-east-1
        role-to-assume: ${{ vars.oidc_staging_iam_role }}
        role-duration-seconds: "3600"
    - name: Configure container registry for staging ECR
      id: ecrconfig
      uses: cloudbees-io/configure-ecr-credentials@v1
    - name: Push Helm chart
      id: push-chart
      uses: cloudbees-io/helm-push@v1
      with:
        chart: ${{ steps.package.outputs.chart }}
        remote: oci://123456789012.dkr.ecr.us-east-1.amazonaws.com/for-testing
    - name: Verify the output
      uses: docker://alpine/helm:3.12.1
      run: |
        set -x
        [ "$CHART" = oci://123456789012.dkr.ecr.us-east-1.amazonaws.com/for-testing/example-chart ]
        [ "$VERSION" = 3.2.1 ]
        MANIFEST="$(helm template myrelease $CHART --version=$VERSION)"
        echo "$MANIFEST" | grep -q "my example data"
        echo "The artifact ID for $CHART:$VERSION is ${{ steps.push-chart.outputs.artifact-id }}"
      env:
        CHART: ${{ steps.push-chart.outputs.chart }}
        VERSION: ${{ steps.push-chart.outputs.version }}

After the run has completed, the artifact version and chart reference output are displayed in both Artifacts and Run details > Build artifacts in the CloudBees platform.

Refer to the artifact documentation for more information.

License

This code is made available under the MIT license.

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 8