Skip to content

Commit

Permalink
Merge branch 'cpg-guidance' of https://github.com/hl7-be/pss into cpg…
Browse files Browse the repository at this point in the history
…-guidance
  • Loading branch information
costateixeira committed Nov 11, 2024
2 parents fdb83b0 + f2df2bc commit 7cdd27d
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# This is a simple workflow that runs the publisher and copies the output to https://<owner>.github.io/<repo>/index.html
# Based on the instructions from Elliot Silver, available from: https://www.argentixinfo.com/archives/156

# Make sure your repo has a branch called gh-pages

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events for any main branch
push:
branches-ignore:
- 'gh-pages'
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/[email protected]

- name: Get branch name
run: |
echo ${GITHUB_REF##*/}
echo ${{ steps.branch-name.outputs.current_branch }}
echo ${{ steps.branch-name.outputs.is_default }}
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Update the image to the latest publisher
uses: docker://hl7fhir/ig-publisher-base:latest
with:
# Get the latest publisher - don't run the batch script but run the line directly
args: curl -L https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar -o ./input-cache/publisher.jar --create-dirs

- name: Create package cache folder
uses: docker://hl7fhir/ig-publisher-base:latest
with:
entrypoint: /bin/sh
args: -c "mkdir -p ./fhir-package-cache && chown 1001:127 ./fhir-package-cache"

- name: Run the IG publisher
uses: docker://hl7fhir/ig-publisher-base:latest
with:
# Run the publisher - don't run the batch script but run the line directly
args: java -Xmx4g -jar ./input-cache/publisher.jar publisher -ig . -auto-ig-build -repo https://github.com/${{github.repository}} -package-cache-folder ./fhir-package-cache

- name: Deploy candidate
uses: JamesIves/[email protected]
if: ${{ steps.branch-name.outputs.is_default }} == 'false'
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./output # The folder the action should deploy.
commit-message: Deploy candidate branch
target-folder: branches/${{ steps.branch-name.outputs.current_branch }}
clean: false

- name: Deploy main
uses: JamesIves/[email protected]
if: ${{ steps.branch-name.outputs.is_default }} == 'true'
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./output # The folder the action should deploy.
commit-message: Deploy main branch
clean-exclude: branches

0 comments on commit 7cdd27d

Please sign in to comment.