Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions .github/workflows/kubernetes-charts-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
push:
branches: [ main ]
tags:
- 'v*.*.*' # e.g., v0.1.1
- 'helm-charts-v*.*.*' # e.g., helm-charts-v0.1.1
pull_request:
paths:
- 'deployment/kubernetes/**'
- 'deployment/kubernetes/charts/**'
- '.github/workflows/kubernetes**'

defaults:
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch}})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
echo "changed=true" >> "$GITHUB_UTPUT"
fi

- name: Run chart-testing (lint)
Expand All @@ -60,8 +60,10 @@ jobs:
helm-publish:
runs-on: ubuntu-latest
needs: helm-lint-test
permissions:
contents: write
env:
CHART_VERSION: 0.0.1
DEFAULT_CHART_VERSION: 0.0.1
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v1
Expand All @@ -77,15 +79,35 @@ jobs:
- name: Checkout
uses: actions/checkout@v5

- name: Determine version
id: version
run: |
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
# Strip the tag prefix chart-
CHART_VERSION="${GITHUB_REF_NAME#helm-charts-}"
else
CHART_VERSION="$DEFAULT_CHART_VERSION"
fi
echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT"

- name: Package Helm Charts
run: |
helm package ./charts/medcat-service-helm --version $CHART_VERSION
helm package ./charts/medcat-trainer-helm --version $CHART_VERSION --dependency-update
helm package ./charts/medcat-service-helm --version ${{ steps.version.outputs.chart_version }}
helm package ./charts/medcat-trainer-helm --version ${{ steps.version.outputs.chart_version }} --dependency-update

- name: Helm OCI login to Docker Hub
run: helm registry login registry-1.docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}

- name: Push Helm Chart to Docker Hub OCI
run: |
helm push ./medcat-service-helm-${CHART_VERSION}.tgz oci://registry-1.docker.io/cogstacksystems
helm push ./medcat-trainer-helm-${CHART_VERSION}.tgz oci://registry-1.docker.io/cogstacksystems
helm push ./medcat-service-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems
helm push ./medcat-trainer-helm-${{ steps.version.outputs.chart_version }}.tgz oci://registry-1.docker.io/cogstacksystems

- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
draft: true
files: |
./deployment/kubernetes/medcat-service-helm-${{ steps.version.outputs.chart_version }}.tgz
./deployment/kubernetes/medcat-trainer-helm-${{ steps.version.outputs.chart_version }}.tgz
Loading