Publish Helm chart #1
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 | |
# main branch to Khulnasoft Security repository at https://github.com/khulnasoft/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: khulnasoft | |
CHART_DIR: helm/harbor-scanner-khulnasoft | |
jobs: | |
release: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: "${{ github.event.inputs.ref }}" | |
fetch-depth: 1 | |
- name: Install Helm | |
uses: azure/setup-helm@v4 | |
with: | |
version: v3.5.0 | |
- name: Install chart-releaser | |
run: | | |
wget https://github.com/helm/chart-releaser/releases/download/v1.3.0/chart-releaser_1.3.0_linux_amd64.tar.gz | |
tar xzvf chart-releaser_1.3.0_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/[email protected] | |
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: 'khulnasoft-bot' |