Manual Publish Helm Chart #4
This file contains hidden or 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
| name: Manual Publish Helm Chart | |
| defaults: | |
| run: | |
| working-directory: deployments/kubernetes/charts/clowder2 | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| force: | |
| description: "Force push the chart even if it already exists (true/false)" | |
| type: boolean | |
| default: true | |
| env: | |
| MAIN_REPO: clowder-framework/clowder2 | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Helm Repositories | |
| run: | | |
| helm repo add bitnami-legacy https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami | |
| helm repo add ncsa https://opensource.ncsa.illinois.edu/charts | |
| helm repo update | |
| helm dep update | |
| - name: Determine Chart Version & Changelog | |
| id: release_info | |
| run: | | |
| version="$(awk '/^version:/ { print $2 }' Chart.yaml)" | |
| changelog="$(sed -e "1,/^### ${version}/d" -e "/^###/,\$d" -e '/^$/d' README.md)" | |
| changelog="${changelog//'%'/'%25'}" | |
| changelog="${changelog//$'\n'/'%0A'}" | |
| changelog="${changelog//$'\r'/'%0D'}" | |
| echo "version=${version}" >> $GITHUB_ENV | |
| echo "changelog=${changelog}" >> $GITHUB_ENV | |
| echo "version: ${version}" | |
| echo "changelog: ${changelog}" | |
| - name: Debug GitHub Metadata | |
| run: | | |
| echo "Manual dispatch workflow triggered" | |
| echo "github.repository: ${{ github.repository }}" | |
| echo "chart version: ${{ env.version }}" | |
| - name: Validate Helm Template | |
| run: helm template . | |
| - name: Publish Helm Chart to NCSA OpenSource | |
| if: github.repository == env.MAIN_REPO | |
| uses: bsord/[email protected] | |
| with: | |
| username: ${{ secrets.HELM_USERNAME }} | |
| password: ${{ secrets.HELM_PASSWORD }} | |
| registry-url: "https://opensource.ncsa.illinois.edu/charts" | |
| chart-folder: "deployments/kubernetes/charts/clowder2" | |
| force: ${{ github.event.inputs.force }} |