Merge pull request #7 from killianmuldoon/pr-add-utils #12
Workflow file for this run
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: Publish Helm Chart | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| publish-helm: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Install Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: 'latest' | |
| - name: Determine tag | |
| id: tag | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
| TAG=${GITHUB_REF#refs/tags/} | |
| else | |
| TAG=v25.7.1-${GITHUB_SHA::7} | |
| fi | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| - name: Log in to Container Registry | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} --username ${{ github.actor }} --password-stdin | |
| - name: Build Helm chart | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| make helm-build TAG=${{ steps.tag.outputs.tag }} REGISTRY=ghcr.io/mellanox | |
| - name: Build and publish Helm chart | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| make helm-publish TAG=${{ steps.tag.outputs.tag }} REGISTRY=ghcr.io/mellanox | |