-
Notifications
You must be signed in to change notification settings - Fork 17
148 lines (128 loc) · 4.96 KB
/
cd_update_pages.yml
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Update GitHub Pages
on:
push:
branches:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-*'
- cd_update_pages
env:
GIT_USER_NAME: EMMO Developers
GIT_USER_EMAIL: "emmo@emmc.eu"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Debug info
run: |
echo "GITHUB_REF_NAME=${GITHUB_REF_NAME}"
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install ROBOT
run: |
mkdir bin
wget -nv https://github.com/ontodev/robot/releases/download/v1.9.6/robot.jar
mv robot.jar bin/.
curl https://raw.githubusercontent.com/ontodev/robot/master/bin/robot > bin/robot
chmod +x bin/robot
ls -l bin/
- name: Install dependencies
run: |
pip install --upgrade pip
pip install sphinx sphinxcontrib-globalsubs sphinx_design nbsphinx pydata-sphinx-theme
pip install git+https://github.com/emmo-repo/EMMOntoPy.git@master
#pip install sphinx EMMOntoPy
- name: Create and prepare build and public directories
run: |
mkdir build public
if [ -d doc/_static ]; then cp -rf doc/_static/* build/. ; fi
- name: Create ontologies for publishing
run: |
ontoconvert -sawe --base-iri="https://w3id.org/emmo#" --iri=https://w3id.org/emmo emmo.ttl public/emmo.ttl
ontoconvert -sawe --base-iri="https://w3id.org/emmo#" --iri=https://w3id.org/emmo emmo-full.ttl public/emmo-full.ttl
#ontoconvert --reasoner=Pellet public/emmo.ttl public/emmo-inferred.ttl
#ontoconvert --reasoner=Pellet public/emmo-full.ttl public/emmo-full-inferred.ttl
bin/robot reason --reasoner ELK --input public/emmo.ttl --output public/emmo-inferred.ttl
bin/robot reason --reasoner ELK --input public/emmo-full.ttl --output public/emmo-full-inferred.ttl
ontoconvert public/emmo.ttl public/emmo.owl
ontoconvert public/emmo-full.ttl public/emmo-full.owl
ontoconvert public/emmo-inferred.ttl public/emmo-inferred.owl
ontoconvert public/emmo-full-inferred.ttl public/emmo-full-inferred.owl
- name: Generate html documentation (based on emmo-full)
run: |
#ontodoc --iri-regex=https://w3id.org/emmo --imported public/emmo-full-inferred.ttl build/emmo.rst
ontodoc --iri-regex=https://w3id.org/emmo --imported emmo-full.ttl build/emmo.rst
sphinx-build "build/" "public/"
- name: Checkout GitHub Pages for EMMO-repo
uses: actions/checkout@v4
with:
repository: emmo-repo/emmo-repo.github.io
path: pages
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh-strict: no
- name: Copy to GitHub Pages
run: |
# Do not overwrite index.html
rm public/index.html
# Tell GitHub that this site is not generated with jekyll
touch public/.nojekyll
# Copy to latest (root)
cp -rf public/* pages/.
# Copy to version
VERSION=$(git rev-parse --abbrev-ref HEAD)
if [ ! -d pages/versions/${VERSION} ]; then \
mkdir pages/versions/${VERSION}
fi
cp -rf public/* pages/versions/${VERSION}/.
# Domain repositories can use peaceiris/actions-gh-pages@v3.
# However, since EMMO for historical reasons uses a separate repo
# for its GitHub Pages, it is easier to use git directly.
- name: Push to GitHub Pages
run: |
cd pages
git config --global user.email "emmo@emmc.eu"
git config --global user.name "EMMO Developer"
git add --all
if [ -n "$(git status --porcelain -uno)" ]; then \
git commit -m 'Updated releasetable'; \
git pull origin master; \
git push origin master; \
fi
#- name: Publish
# uses: peaceiris/actions-gh-pages@v3
# if: github.ref == 'refs/heads/master'
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public
# #keep_files: true
# #external_repository: emmo-repo emmo-repo.github.io
#
# #publish_branch: master
# #force_orphan: true
# - name: Install pandoc 2.1.2
# run: |
# #sudo apt-get install pandoc # we need v2.1.2
# wget https://github.com/jgm/pandoc/releases/download/2.1.2/pandoc-2.1.2-1-amd64.deb
# sudo apt-get install ./pandoc-2.1.2-1-amd64.deb
#
# - name: Install other dependencies
# run: |
# sudo apt-get install graphviz
# sudo apt-get install texlive-xetex
# sudo apt-get install texlive-latex-extra
# pip install semver
#
# - name: Checkout GitHub Pages for EMMO-repo
# uses: actions/checkout@v4
# with:
# repository: emmo-repo/emmo-repo.github.io
# path: ".github/pages"
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
# ssh-strict: no
#
# - name: Update GitHub Pages
# run: |
# .github/scripts/update_pages.sh -v -V ${GITHUB_REF_NAME}