Skip to content

Gen IG and publish GH pages #9

Gen IG and publish GH pages

Gen IG and publish GH pages #9

Workflow file for this run

name: Gen IG and publish GH pages
on:
workflow_dispatch:
# The short name is used to identify the IG and the folder where the IG is located
env:
IG_SHORTNAME: mal
# The following jobs are equal for all IGs and can be moved to a common composite-action if 'uses'-support is added, see:
# https://github.com/actions/runner/blob/main/docs/adrs/1144-composite-actions.md
# "Hardkodet" for no-basis 2.2.0
jobs:
publish:
runs-on: ubuntu-latest
container: hl7fhir/ig-publisher-base:latest
steps:
- uses: actions/checkout@v4
- name: 🖥️ Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
- name: Install 🔥 FHIR packages 🇳🇴
run: |
echo "NPM install fhir r4 core 4.0.1 from package registry"
npm --registry https://packages.simplifier.net install [email protected]
echo "NPM install hl7.fhir.no.basis-2.2.0 from https://github.com/HL7Norway/resources/"
curl -L -o hl7.fhir.no.basis-2.2.0-snapshots.tgz https://raw.githubusercontent.com/HL7Norway/resources/main/snapshots/hl7.fhir.no.basis-2.2.0-snapshots.tgz
npm install hl7.fhir.no.basis-2.2.0-snapshots.tgz
echo "Create .fhir packages cache directory for no-basis"
mkdir -p /github/home/.fhir/packages/hl7.fhir.no.basis#2.2.0/package
echo "Copy local no-basis snapshot to .fhir package cache directory"
cp -r ./node_modules/hl7.fhir.no.basis/* /github/home/.fhir/packages/hl7.fhir.no.basis#2.2.0/package
- name: Run 🔥 IG Publsher with 🍣 Sushi
run: |
cd ${{ env.IG_SHORTNAME }}
echo "Get latest publisher"
curl -L https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar -o ./input-cache/publisher.jar --create-dirs
echo "Install Sushi compiler"
npm install -g fsh-sushi
echo "Run IG publisher"
java -jar ./input-cache/publisher.jar publisher -ig ig.ini
# Publishes the HTML page to a seperate branch in order to host it using GitHub-Pages.
# This will overwrite the currently published HTML page.
- name: 🚀 Deploy to GitHub-Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.IG_SHORTNAME }}/output
destination_dir: currentbuild
commit_message: '${{ env.IG }}: ${{ github.event.head_commit.message }}'