ci(helm): publish chart to ghcr oci on release tags
This commit is contained in:
31
.github/workflows/docker-publish.yml
vendored
31
.github/workflows/docker-publish.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user