-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (48 loc) · 1.9 KB
/
build-dev-schema.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
# Updates the development version of the Schema on GitHub Pages each time the ODD is modified in the main branch.
# Uses the build tools from the TEIC/Stylesheets repo to convert the ODD to an RNG schema
name: Build EpiDoc Development Schema
on:
push:
branches: [ main ]
paths:
- 'sigidoc.odd'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# We use this container because it contains Saxon. We don't require anything else from it.
container:
image: teic/teidev-docker:latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Checkout gh-pages branch"
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
# The TEI stylesheets repo contains the build script to convert the ODD source to an RNG schema
- name: "Checkout TEI stylesheets repo"
uses: actions/checkout@v4
with:
repository: "TEIC/Stylesheets"
path: tei-stylesheets
- name: "Build Schema"
run: |
# Convert ODD to RNG
tei-stylesheets/bin/teitorng sigidoc.odd sigidoc.rng
# Copy compiled RNG to the dev directory in the gh-pages branch
rm -rf gh-pages/schema/dev
mkdir -p gh-pages/schema/dev
cp sigidoc.* gh-pages/schema/dev/
# Create directory indices
tree -H '.' -T 'schema/' -I index.html -L 1 --noreport --charset utf-8 -o gh-pages/schema/index.html gh-pages/schema
tree -H '.' -T 'dev/' -I index.html -L 1 --noreport --charset utf-8 -o gh-pages/schema/dev/index.html gh-pages/schema/dev
- name: "Push to gh-pages branch."
run: |
cd gh-pages
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Published development Schema."
git push