Skip to content

Commit

Permalink
Merge pull request #217 from BAMresearch/ghpagesupdate
Browse files Browse the repository at this point in the history
Pages workflow update
  • Loading branch information
AidaZt authored Jan 19, 2024
2 parents f30a276 + 459e095 commit 47dd378
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 22 deletions.
47 changes: 25 additions & 22 deletions .github/workflows/GHPagesOntology.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
name: Deploy

env:
ONTOLOGY_FILE_NAME: lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.ttl

on:
workflow_dispatch:
inputs:
ontology_path:
description: 'Relative path to the ontology file'
required: true
default: 'lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.owl'

workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref_name == 'main'
steps:
## First step: Checkout main from the repository
- uses: actions/checkout@v3
with:
path: repo

- name: Install dependencies
run: |
pip install rdflib
wget -O widoco.jar https://github.com/dgarijo/Widoco/releases/download/v1.4.17/java-11-widoco-1.4.17-jar-with-dependencies.jar
path: deploy_main
## Second step: Use the get_ontoversion tool to get the current ontology version published in main
## Usage of get_ontoversionversion.py:
## python get_ontoversionversion.py [-l L]
## -l L Location of the ontology file
## default: main/ontology.ttl
- name: Get ontology version
run: |
echo "ONTOLOGY_FILE_PATH=${{ github.event.inputs.ontology_path }}"
echo "ONTO_VERSION=$(python repo/.github/workflows/get_ontoversion.py $ONTOLOGY_FILE_PATH)" >> "$GITHUB_ENV"
- name: Build HTML for ontology
pip install rdflib
echo "ONTO_VERSION=$(python deploy_main/.github/workflows/get_ontoversion.py deploy_main/$ONTOLOGY_FILE_NAME)" >> "$GITHUB_ENV"
## Third step: Build HTML and ontology serializations for the current version
- name: Build HTML for main
run: |
mkdir -p public/v$ONTO_VERSION
java -jar widoco.jar -ontFile $ONTOLOGY_FILE_PATH -outFolder public/v$ONTO_VERSION -htaccess -uniteSections -includeAnnotationProperties -lang en-de -getOntologyMetadata -noPlaceHolderText -rewriteAll -webVowl
wget -O widoco.jar https://github.com/dgarijo/Widoco/releases/download/v1.4.17/java-11-widoco-1.4.17-jar-with-dependencies.jar
mkdir public
mkdir public/v$ONTO_VERSION
java -jar widoco.jar -ontFile deploy_main/$ONTOLOGY_FILE_NAME -outFolder public/v$ONTO_VERSION -htaccess -uniteSections -includeAnnotationProperties -lang en-de -getOntologyMetadata -noPlaceHolderText -rewriteAll -webVowl
cp public/v$ONTO_VERSION/index-en.html public/v$ONTO_VERSION/index.html
## Fourth step: Publish HTML docs and ontology serializations to gh pages
## maintaining other versions and
## replacing the current version (if existing)
- name: Deploy to GitHub Pages
if: success()
uses: crazy-max/ghaction-github-pages@v3
Expand All @@ -40,4 +43,4 @@ jobs:
build_dir: public
keep_history: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
dcterms:title "Concrete Production and Testing Ontology"@en ;
dcterms:creator "Mattheo Krüger, Melissa Telong Donfack, Aida Zoriyatkha, Birgit Meng, Stephan Pirskawetz" ,
<https://orcid.org/0009-0003-7121-0283> ,
<https://orcid.org/0009-0006-4524-9143> ,
<https://orcid.org/0009-0004-9700-2439> ,
<https://orcid.org/0000-0003-2445-6734> ,
<https://orcid.org/0000-0003-0626-5002> ;
Expand Down

0 comments on commit 47dd378

Please sign in to comment.