ci: run ci #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # name: SHACL Documentation Generation | |
| # on: | |
| # push: | |
| # paths: | |
| # - 'src/ontology/**' | |
| # pull_request: | |
| # paths: | |
| # - 'src/ontology/**' | |
| # jobs: | |
| # generate-docs: | |
| # runs-on: ubuntu-latest | |
| # steps: | |
| # - name: Checkout repository | |
| # uses: actions/checkout@v4 | |
| # - name: Set up Python and install dependencies | |
| # run: | | |
| # python -m pip install --upgrade pip | |
| # pip install rdflib | |
| # - name: Enrich ontology with rdflib | |
| # id: enrich | |
| # run: | | |
| # python tools/python/docs/sparql.py | |
| # echo "enriched_file=/tmp/enriched.ttl" >> $GITHUB_ENV | |
| # - name: Set up Java 11 | |
| # uses: actions/setup-java@v4 | |
| # with: | |
| # distribution: 'temurin' | |
| # java-version: '11' | |
| # - name: Install Graphviz | |
| # run: | | |
| # sudo apt-get update | |
| # sudo apt-get install -y graphviz | |
| # - name: Set DOT_PATH environment variable | |
| # run: echo "GRAPHVIZ_DOT=/usr/bin/dot" >> $GITHUB_ENV | |
| # - name: Download SHACL Play CLI | |
| # run: | | |
| # wget https://github.com/sparna-git/shacl-play/releases/download/0.10.2/shacl-play-app-0.10.2-onejar.jar -O shacl-play-cli.jar | |
| # - name: Generate Documentation | |
| # run: | | |
| # java -jar shacl-play-cli.jar \ | |
| # doc \ | |
| # -d \ | |
| # -i ${{ env.enriched_file }} \ | |
| # -l en \ | |
| # -o docs/index.html | |
| # - name: Commit generated docs | |
| # run: | | |
| # git config user.name "github-actions[bot]" | |
| # git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # git add docs/index.html | |
| # git commit -m "Update generated docs" || echo "No changes to commit" | |
| # git push | |
| # - name: Upload generated documentation as an artifact | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: shacl-documentation | |
| # path: docs/index.html | |
| name: Generate Public Ontology Docs | |
| on: | |
| push: | |
| paths: | |
| - 'src/ontology/arema-ontology.ttl' | |
| - '.github/workflows/docs.yml' | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Prepare clean public and data directories | |
| run: | | |
| rm -rf public data docs/public | |
| mkdir -p public data | |
| chmod -R 777 public data | |
| cp src/ontology/arema-ontology.ttl data/ | |
| echo "BASEURL=/$(basename $GITHUB_REPOSITORY)" > .env | |
| chmod 666 .env | |
| - name: Run Skohub Vocabs Docker | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}/public:/app/public \ | |
| -v ${{ github.workspace }}/data:/app/data \ | |
| -v ${{ github.workspace }}/.env:/app/.env \ | |
| skohub/skohub-vocabs-docker:latest | |
| - name: Move results to docs/public | |
| run: | | |
| mkdir -p docs/public | |
| cp -r public/* docs/public/ | |
| - name: Commit updated docs | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/public | |
| git diff --cached --quiet || git commit -m "Update docs/public via skohub-vocabs" | |
| git push | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |