Skip to content

Commit

Permalink
add CICD hook for working build
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleOps committed Jul 22, 2024
1 parent 1cef1cb commit 7d6fab7
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/profile_trigger_publication.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Au Core IG Profiles publish->go-publish

on:
push:
tags:
- '**'


permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout

jobs:
build:
runs-on: ubuntu-latest
container: hl7fhir/ig-publisher-base # use ig publisher base image
steps:
- name: Get the tag name
id: get_tag
run: echo "##[set-output name=tag;]${GITHUB_REF#refs/tags/}"

- name: Checkout Publications Repository
uses: actions/checkout@v4
with:
repository: hl7au/publications

- name: Configure AWS credentials from GitHub OIDC
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::966489602583:role/ghactions_publications_oidc
aws-region: ap-southeast-2

- name: Checkout AU core Repository
uses: actions/checkout@v4
with:
repository: hl7au/au-fhir-core
path: hl7au/au-fhir-core

- name: Checkout IG History Template Repository
uses: actions/checkout@v4
with:
repository: HL7/fhir-ig-history-template
path: fhir-history

- name: Checkout IG Registry Repository
uses: actions/checkout@v4
with:
repository: hl7au/ig-registry
path: ig-registry

- name: Update Publisher
run: |
echo "Updating Publisher"
./_updatePublisher.sh -f -y
- name: Basic Publish for Aucore
run: |
echo "Generating Publish for Aucore IG..."
java -jar input-cache/publisher.jar -ig hl7au/au-fhir-core/ig.ini
- name: Create directories
run: |
mkdir -p webroot/fhir/core
- name: Download package-list.json
run: |
rm -rf hl7au/au-fhir-core/package-list.json
URL="https://hl7.org.au/fhir"
FULL_URL="$URL/core/package-list.json"
curl --output webroot/fhir/core/package-list.json --url $FULL_URL
- name: Download package-feed.xml
run: |
curl --output webroot/fhir/package-feed.xml --url https://hl7.org.au/fhir/package-feed.xml
- name: Download publication-feed.xml
run: |
curl --output webroot/fhir/publication-feed.xml --url https://hl7.org.au/fhir/publication-feed.xml
- name: Generate Package Registry
run: |
java -jar input-cache/publisher.jar -generate-package-registry webroot
- name: Run Aucore Publisher build
run: java -jar ./input-cache/publisher.jar -go-publish -source ./hl7au/au-fhir-core -web ./webroot -history ./fhir-history -registry ./ig-registry/fhir-ig-list.json -templates ./templates -tx https://txreg.azurewebsites.net/txdev

- name: List directories
run: |
find . -type d
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: publish-output
path: webroot/fhir/core

# - name: 📂 Sync files # ftp is incredibly slow > 30 min sometimes, costing compute and efficency
# uses: SamKirkland/[email protected]
# with:
# server: ${{secrets.BUILD_SERVER}} # change to be env variable to support multiple environments later on
# username: ${{ secrets.FTP_USER }}
# password: ${{ secrets.FTP_PASSWORD }}
# local-dir: aucore/output/
# server-dir: /ig/hl7au/au-fhir-core/branches/${{ github.ref }}/gopublish/
# dry-run: true

- name: Upload artifacts to S3
run: aws s3 cp ./webroot s3://hl7au-fhir-ig/core/${{ steps.get_tag.outputs.tag }} --recursive

0 comments on commit 7d6fab7

Please sign in to comment.