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.
Input name | Data type | Required? | Description |
---|---|---|---|
|
String |
Yes |
The path of the Helm chart package to be published. |
|
String |
Yes |
The URL of the published Helm chart package. |
Output name | Data type | Description |
---|---|---|
|
String |
The unique identifier of the artifact reported to the CloudBees platform. |
|
String |
The image reference pointing to the chart upload location. |
|
String |
The version of the uploaded Helm chart package. |
Use the Helm package action to package a Helm chart, and this action to publish it.
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
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.
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.
This code is made available under the MIT license.
-
Learn more about using actions in CloudBees workflows.
-
Learn about the CloudBees platform.