This repository has been archived by the owner on Sep 20, 2024. It is now read-only.
Publish Helm Chart #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# This is a manually triggered workflow to package and upload the Helm chart | |
# from the specified Git revision to Aqua Security Helm repository at | |
# https://github.com/aquasecurity/helm-charts. | |
name: Publish Helm Chart | |
on: | |
workflow_dispatch: | |
inputs: | |
ref: | |
description: Git revision to be published | |
required: true | |
env: | |
HELM_REP: helm-charts | |
GH_OWNER: aquasecurity | |
CHART_DIR: helm/harbor-scanner-trivy | |
jobs: | |
release: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: "${{ github.event.inputs.ref }}" | |
fetch-depth: 1 | |
- name: Install Helm | |
uses: azure/setup-helm@v3 | |
with: | |
version: v3.7.0 | |
- name: Download Chart Releaser | |
run: | | |
wget https://github.com/helm/chart-releaser/releases/download/v1.2.1/chart-releaser_1.2.1_linux_amd64.tar.gz | |
echo 'b6d1916db690ccd789b17b75a66db0dc6a171e6f971a06872b87a3e31592cb08 chart-releaser_1.2.1_linux_amd64.tar.gz' | sha256sum --check | |
- name: Install Chart Releaser | |
run: | | |
tar xzvf chart-releaser_1.2.1_linux_amd64.tar.gz cr | |
- name: Package helm chart | |
run: | | |
./cr package ${{ env.CHART_DIR }} | |
- name: Upload helm chart | |
# Failed with upload the same version: https://github.com/helm/chart-releaser/issues/101 | |
continue-on-error: true | |
run: | | |
./cr upload --owner ${{ env.GH_OWNER }} \ | |
--git-repo ${{ env.HELM_REP }} \ | |
--token ${{ secrets.ORG_REPO_TOKEN }} \ | |
--package-path .cr-release-packages | |
- name: Index helm chart | |
run: | | |
./cr index --owner ${{ env.GH_OWNER }} \ | |
--git-repo ${{ env.HELM_REP }} \ | |
--charts-repo https://${{ env.GH_OWNER }}.github.io/${{ env.HELM_REP }}/ \ | |
--index-path index.yaml | |
- name: Push index file | |
uses: dmnemec/copy_file_to_another_repo_action@c93037aa10fa8893de271f19978c980d0c1a9b37 | |
env: | |
API_TOKEN_GITHUB: ${{ secrets.ORG_REPO_TOKEN }} | |
with: | |
source_file: 'index.yaml' | |
destination_repo: '${{ env.GH_OWNER }}/${{ env.HELM_REP }}' | |
destination_folder: '.' | |
destination_branch: 'gh-pages' | |
user_email: [email protected] | |
user_name: 'aqua-bot' |