diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 9e8fd80..9b0394d 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -44,3 +44,34 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max + + publish-chart: + name: Package & push Helm chart to GHCR + runs-on: ubuntu-latest + needs: [publish] + if: startsWith(github.ref, 'refs/tags/') + steps: + - uses: actions/checkout@v4 + + - uses: azure/setup-helm@v4 + + - name: Derive chart version + id: version + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT" + + - name: Log in to GHCR (Helm OCI) + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io \ + --username "${{ github.actor }}" \ + --password-stdin + + - name: Package chart + run: | + helm package charts/openconcho \ + --version "${{ steps.version.outputs.VERSION }}" \ + --app-version "${{ steps.version.outputs.VERSION }}" + + - name: Push chart + run: | + helm push "openconcho-${{ steps.version.outputs.VERSION }}.tgz" \ + oci://ghcr.io/${{ github.repository_owner }}/charts