-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87986ad
commit ba79a02
Showing
2 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This is a simple workflow that runs the HL/ FHIR IG Publisher, which builds the IG in https://build.fhir.ig/ig/<repo>/index.html | ||
|
||
name: Trigger HL7 FHIR Autobuild | ||
run-name: ${{ github.actor }} triggered a GitHub Action | ||
on: | ||
workflow_call: # Reusable by other workflows | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
Explore-GitHub-Actions: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "${{ github.ref }} - ${{ github.repository }}" | ||
- run: | | ||
curl --request POST \ | ||
--header 'content-type: application/json' \ | ||
--url https://us-central1-fhir-org-starter-project.cloudfunctions.net/ig-commit-trigger \ | ||
--data '{"ref": "${{ github.ref }}", "repository": {"full_name": "${{ github.repository }}"}}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# This is a simple workflow that runs the publisher and copies the output to https://<owner>.github.io/<repo>/index.html | ||
# Based on the idea from Carl Leitner | ||
# Change log: | ||
# 2021-06-18: (JCT): publish default branches to / , other branches branches/<branch> | ||
# 2021-11-26: (JCT): Reusable workflow | ||
# 2022-01-28: (JCT): add auto-create gh-pages if it doesn't exist | ||
# 2023-01-22: (JCT): use checkout action v3, and JamesIves/github-pages-deploy-action@v4 | ||
|
||
|
||
# Make sure your repo has a branch called gh-pages | ||
|
||
name: CI | ||
|
||
# Controls when the action will run. | ||
on: | ||
workflow_call: # Reusable by other workflows | ||
# Triggers the workflow on push or pull request events for any 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 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
|
||
- name: Get branch name | ||
run: echo ${GITHUB_REF##*/} | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
# - name: Create gh-pages branch if it doesn't exist | ||
# run: | | ||
# git fetch origin | ||
# exists=`git show-ref refs/heads/gh-pages` | ||
# if [ -n "$exists" ]; then | ||
# echo 'gh-pages branch exists'; | ||
# else | ||
# echo 'gh-pages branch does not exist, creating it'; | ||
# git checkout --orphan gh-pages | ||
# git reset --hard | ||
# git commit --allow-empty -m "Initializing gh-pages branch" | ||
# git push origin gh-pages | ||
# git checkout ${GITHUB_REF##*/} | ||
# fi | ||
|
||
- 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: 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}} | ||
|
||
- name: Get branch names | ||
id: branch-name | ||
uses: tj-actions/[email protected] | ||
|
||
- 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 }} | ||
single-commit: true | ||
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 | ||
single-commit: true | ||
clean-exclude: branches |