Publish Helm chart #6
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
name: Publish Helm chart | |
on: | |
workflow_dispatch: | |
jobs: | |
publish: | |
name: Publish Helm Chart to GitHub Container registry | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
defaults: | |
run: | |
working-directory: ./charts/dangobot | |
steps: | |
- name: Checkout the repository | |
uses: actions/checkout@v4 | |
- name: Add chart dependencies to Helm | |
run: helm repo add bitnami https://charts.bitnami.com/bitnami | |
- name: Download chart dependencies | |
run: helm dependency build | |
- name: Package chart | |
run: helm package . | |
- name: Get the chart version | |
id: vars | |
run: echo "version=$(helm show chart . | grep -E "^version:" | awk '{print $2}')" >> $GITHUB_OUTPUT | |
- name: Login to GitHub Container Registry | |
run: echo '${{ secrets.GITHUB_TOKEN }}' | helm registry login -u '${{ github.repository_owner }}' --password-stdin ghcr.io/${{ github.repository_owner }} | |
- name: Push package | |
run: helm push dangobot-${{ steps.vars.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/dangobot | |
- name: Get image | |
id: output | |
shell: bash | |
run: echo 'image=${{ inputs.registry }}/${{ inputs.repository }}/${{ inputs.name }}:${{ inputs.tag }}' >> $GITHUB_OUTPUT |