Skip to content

publish-chart

publish-chart #18

Workflow file for this run

name: publish-chart
permissions:
packages: write
contents: read
on:
# TODO publish for releases
workflow_run:
workflows: ["publish-image"]
types: [completed]
branches: ["master"]
jobs:
publish-chart:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- chart_name: metaproxy
chart_base_version: "0.1.0-master.${{ github.run_number }}"
chart_path: ./chart
steps:
- uses: actions/checkout@v4
- name: Calculate chart and app version with short SHA
run: |
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
CHART_VERSION="${{ matrix.chart_base_version }}+sha.$SHORT_SHA"
APP_VERSION="sha-$SHORT_SHA"
echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
- 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 "$CHART_VERSION" --app-version "$APP_VERSION"
- name: helm push
run: |
helm push "${{ matrix.chart_name }}-$CHART_VERSION.tgz" oci://ghcr.io/${{ github.repository_owner }}/charts