chore: release 1.6.0 #843
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
release: | |
types: | |
# If you want a workflow to run when stable and pre-releases publish, subscribe to published instead of released and prereleased. | |
# <https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release> | |
- published | |
permissions: read-all | |
env: | |
DIZBOX_NAMESPACE_NAME: bzkf-dizbox | |
DECOMPOSE_XML_IMAGE_NAME: ghcr.io/${{ github.repository }}/decompose-xmls | |
ADTFHIR_TO_OPAL_IMAGE_NAME: ghcr.io/${{ github.repository }}/adtfhir-to-opal | |
jobs: | |
build-decompose-xml-image: | |
name: build decompose_xmls container image | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
outputs: | |
image-tags: ${{ steps.container_meta.outputs.tags }} | |
image-digest: ${{ steps.build.outputs.digest }} | |
image-name: ${{ env.DECOMPOSE_XML_IMAGE_NAME }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 | |
- name: Container meta | |
id: container_meta | |
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5 | |
with: | |
images: | | |
${{ env.DECOMPOSE_XML_IMAGE_NAME }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
id: build | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5 | |
with: | |
context: src/decompose_xmls | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.container_meta.outputs.tags }} | |
labels: ${{ steps.container_meta.outputs.labels }} | |
load: ${{ github.event_name == 'pull_request' }} | |
build-adtfhir-to-opal-image: | |
name: build adtfhir_to_opal container image | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
outputs: | |
image-tags: ${{ steps.container_meta.outputs.tags }} | |
image-digest: ${{ steps.build.outputs.digest }} | |
image-name: ${{ env.ADTFHIR_TO_OPAL_IMAGE_NAME }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 | |
- name: Container meta | |
id: container_meta | |
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5 | |
with: | |
images: | | |
${{ env.ADTFHIR_TO_OPAL_IMAGE_NAME }} | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 | |
if: ${{ github.event_name != 'pull_request' }} | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
id: build | |
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5 | |
with: | |
context: src/adtfhir_to_opal | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.container_meta.outputs.tags }} | |
labels: ${{ steps.container_meta.outputs.labels }} | |
load: ${{ github.event_name == 'pull_request' }} | |
test: | |
runs-on: ubuntu-22.04 | |
# run tests only on PRs | |
if: ${{ github.event_name == 'pull_request' }} | |
needs: | |
- build-decompose-xml-image | |
- build-adtfhir-to-opal-image | |
steps: | |
- name: install k3s | |
run: | | |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.26.1+k3s1 sh - | |
- name: setup .kube/config | |
run: | | |
mkdir ~/.kube | |
sudo k3s kubectl config view --raw | tee ~/.kube/config > /dev/null | |
chmod 600 ~/.kube/config | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- name: install dependencies | |
run: | | |
kubectl get node | |
# via <https://stackoverflow.com/a/65411733> | |
kubectl create namespace "${DIZBOX_NAMESPACE_NAME}" --dry-run=client -o yaml | kubectl apply -f - | |
kubectl config set-context --current --namespace="${DIZBOX_NAMESPACE_NAME}" | |
kubectl config view | |
helm dependency build charts/prerequisites | |
helm upgrade --install --wait --timeout=10m diz-in-a-box-prerequisites charts/prerequisites | |
kubectl apply -f k8s/ | |
kubectl wait kafka/bzkf-dizbox-cluster --for=condition=Ready --timeout=300s | |
kubectl wait kafkabridge/bzkf-dizbox-bridge --for=condition=Ready --timeout=300s | |
kubectl apply -f k8s/kafka-bridge.yaml | |
kubectl wait kafkabridge/bzkf-dizbox-bridge --for=condition=Ready --timeout=300s | |
kubectl get all -A | |
- name: install diz-in-a-box | |
run: | | |
helm repo add miracum https://miracum.github.io/charts | |
helm repo add akhq https://akhq.io/ | |
helm repo add hapi-fhir-jpaserver-starter https://hapifhir.github.io/hapi-fhir-jpaserver-starter | |
helm dependency build charts/diz-in-a-box | |
helm upgrade --install --wait --timeout=10m diz-in-a-box charts/diz-in-a-box | |
kubectl get all -A | |
- name: test deployments | |
run: | | |
helm test diz-in-a-box | |
kubectl wait deployment/diz-in-a-box-stream-processors-onkoadt-to-fhir --for=condition=Available --timeout=300s | |
kubectl wait deployment/diz-in-a-box-stream-processors-fhir-to-server --for=condition=Available --timeout=300s | |
- name: Print cluster logs | |
if: always() | |
run: | | |
kubectl cluster-info dump -o yaml | tee kind-cluster-dump.txt | |
- name: Upload cluster dump | |
if: always() | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 | |
with: | |
name: kind-cluster-dump.txt | |
path: | | |
kind-cluster-dump.txt | |
build-air-gapped-installer: | |
runs-on: ubuntu-22.04 | |
if: ${{ github.event_name == 'pull_request' }} | |
steps: | |
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- run: | | |
./build-air-gapped-installer.sh | |
release: | |
if: ${{ startsWith(github.ref, 'refs/tags/') }} | |
permissions: | |
actions: read | |
contents: write | |
id-token: write | |
packages: write | |
needs: | |
- build-decompose-xml-image | |
- build-adtfhir-to-opal-image | |
uses: ./.github/workflows/release.yaml |