diff --git a/.github/workflows/GHPagesOntology.yml b/.github/workflows/GHPagesOntology.yml index 72237c3a5..058d0d514 100644 --- a/.github/workflows/GHPagesOntology.yml +++ b/.github/workflows/GHPagesOntology.yml @@ -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 @@ -40,4 +43,4 @@ jobs: build_dir: public keep_history: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.owl b/lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.ttl similarity index 99% rename from lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.owl rename to lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.ttl index 9287deab9..3acf8b7a7 100644 --- a/lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.owl +++ b/lebedigital/ConcreteOntology/BaseOntology/ConcreteProductionAndTestingOntology.ttl @@ -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" , , + , , , ;