CloudBees action: Push a Helm chart

2 minute read

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.

All CloudBees action repositories are listed at CloudBees, Inc. on GitHub.

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

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 CloudBees action: Package a Helm chart to package a Helm chart, and this action to publish it.

Basic example

The following is a basic example of using the action:

- name: Push Helm chart uses: https://github.com/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 - id: package name: Package the Helm chart 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" - id: ecrconfig name: Configure container registry for staging ECR uses: cloudbees-io/configure-ecr-credentials@v1 - id: action name: Publish Helm 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" env: CHART: ${{ steps.action.outputs.chart }} VERSION: ${{ steps.action.outputs.version }}

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

Artifact details
Figure 1. Artifact information in Run details  Build artifacts

Refer to Build artifacts for more information.