Skip to content

publish-chart

publish-chart #14

Workflow file for this run

name: publish-chart
permissions:
packages: write
contents: read
on:
# we only publish the chart after succesful Docker build so we trigger
# a full build when chart templates are changed, this is slightly suboptimal
# TODO automatically bump chart version during build
workflow_run:
workflows: ["publish-image"]
types: [completed]
branches: ["main"]
jobs:
publish-chart:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- chart_name: okapi-hooks
chart_version: "0.1.0-main.${{ github.run_number }}"
chart_path: chart
steps:
- uses: actions/checkout@v4
- name: helm lint
run: |
helm lint ${{ matrix.chart_path }}
- name: helm login
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u $ --password-stdin
- name: helm package
run: |
helm package ${{ matrix.chart_path }} --version "${{ matrix.chart_version }}+sha.$(echo $GITHUB_SHA | cut -c1-7)"
- name: helm push
run: |
helm push "${{ matrix.chart_name }}-${{ matrix.chart_version }}+sha.$(echo $GITHUB_SHA | cut -c1-7).tgz" oci://ghcr.io/${{ github.repository_owner }}/charts