-
Notifications
You must be signed in to change notification settings - Fork 2
120 lines (97 loc) · 3.32 KB
/
docs.yaml
File metadata and controls
120 lines (97 loc) · 3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# 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
run: |
rm -rf docs/*
cp -r public/* docs/
- 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 }}