Skip to content

Commit 6bbb708

Browse files
committed
updates to gh deploy
1 parent df34e9c commit 6bbb708

File tree

2 files changed

+25
-22
lines changed

2 files changed

+25
-22
lines changed

.github/workflows/GHPagesOntology.yml

+25-22
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,40 @@
11
name: Deploy
22

3+
env:
4+
ONTOLOGY_FILE_NAME: lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.ttl
5+
36
on:
4-
workflow_dispatch:
5-
inputs:
6-
ontology_path:
7-
description: 'Relative path to the ontology file'
8-
required: true
9-
default: 'lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.owl'
10-
7+
workflow_dispatch:
8+
119
jobs:
1210
deploy:
1311
runs-on: ubuntu-latest
12+
if: github.ref_name == 'main'
1413
steps:
14+
## First step: Checkout main from the repository
1515
- uses: actions/checkout@v3
1616
with:
17-
path: repo
18-
19-
- name: Install dependencies
20-
run: |
21-
pip install rdflib
22-
wget -O widoco.jar https://github.com/dgarijo/Widoco/releases/download/v1.4.17/java-11-widoco-1.4.17-jar-with-dependencies.jar
23-
17+
path: deploy_main
18+
## Second step: Use the get_ontoversion tool to get the current ontology version published in main
19+
## Usage of get_ontoversionversion.py:
20+
## python get_ontoversionversion.py [-l L]
21+
## -l L Location of the ontology file
22+
## default: main/ontology.ttl
2423
- name: Get ontology version
2524
run: |
26-
echo "ONTOLOGY_FILE_PATH=${{ github.event.inputs.ontology_path }}"
27-
echo "ONTO_VERSION=$(python repo/.github/workflows/get_ontoversion.py $ONTOLOGY_FILE_PATH)" >> "$GITHUB_ENV"
28-
29-
- name: Build HTML for ontology
25+
pip install rdflib
26+
echo "ONTO_VERSION=$(python deploy_main/.github/workflows/get_ontoversion.py deploy_main/$ONTOLOGY_FILE_NAME)" >> "$GITHUB_ENV"
27+
## Third step: Build HTML and ontology serializations for the current version
28+
- name: Build HTML for main
3029
run: |
31-
mkdir -p public/v$ONTO_VERSION
32-
java -jar widoco.jar -ontFile $ONTOLOGY_FILE_PATH -outFolder public/v$ONTO_VERSION -htaccess -uniteSections -includeAnnotationProperties -lang en-de -getOntologyMetadata -noPlaceHolderText -rewriteAll -webVowl
30+
wget -O widoco.jar https://github.com/dgarijo/Widoco/releases/download/v1.4.17/java-11-widoco-1.4.17-jar-with-dependencies.jar
31+
mkdir public
32+
mkdir public/v$ONTO_VERSION
33+
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
3334
cp public/v$ONTO_VERSION/index-en.html public/v$ONTO_VERSION/index.html
34-
35+
## Fourth step: Publish HTML docs and ontology serializations to gh pages
36+
## maintaining other versions and
37+
## replacing the current version (if existing)
3538
- name: Deploy to GitHub Pages
3639
if: success()
3740
uses: crazy-max/ghaction-github-pages@v3
@@ -40,4 +43,4 @@ jobs:
4043
build_dir: public
4144
keep_history: true
4245
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)