Gen IG and publish GH pages #2
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: Gen IG and publish GH pages | |
on: | |
workflow_dispatch: | |
env: | |
IG: 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: Cache Node.js modules | |
uses: actions/cache@v4 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install FHIR packages and run IG Publisher | |
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 fhir no-basis220 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 | |
cd ${{ env.IG }} | |
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 }}/output | |
destination_dir: currentbuild | |
commit_message: '${{ env.IG }}: ${{ github.event.head_commit.message }}' |