1
1
name : Deploy
2
2
3
+ env :
4
+ ONTOLOGY_FILE_NAME : lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.ttl
5
+
3
6
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
+
11
9
jobs :
12
10
deploy :
13
11
runs-on : ubuntu-latest
12
+ if : github.ref_name == 'main'
14
13
steps :
14
+ # # First step: Checkout main from the repository
15
15
- uses : actions/checkout@v3
16
16
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
24
23
- name : Get ontology version
25
24
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
30
29
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
33
34
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)
35
38
- name : Deploy to GitHub Pages
36
39
if : success()
37
40
uses : crazy-max/ghaction-github-pages@v3
40
43
build_dir : public
41
44
keep_history : true
42
45
env :
43
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
46
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments