-
Notifications
You must be signed in to change notification settings - Fork 10
85 lines (73 loc) · 2.65 KB
/
Copy pathmain.yml
File metadata and controls
85 lines (73 loc) · 2.65 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
# Automatic generation of documentation, deployed to the gh-pages branch from master.
name: Documentation generation CI
on:
push:
branches: ["master", "feat/**", "fix/**"]
paths-ignore:
- "**/*.md"
- "doc/**"
pull_request:
branches: ["master", "feat/**", "fix/**"]
paths-ignore:
- "**/*.md"
- "doc/**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Generate documentation
runs-on: ubuntu-latest
steps:
# checkout branch
- uses: actions/checkout@v4
# Install dblatex
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y dblatex dbtoepub xsltproc
# generate the documentation files
- name: Generate documentation
run: |
cd docs
dblatex -s texstyle.sty -T native -t pdf -o mobilitydb-berlinmod.pdf mobilitydb-berlinmod.xml
dbtoepub -o mobilitydb-berlinmod.epub mobilitydb-berlinmod.xml
mkdir html
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o html/index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-berlinmod.xml
cp -r images docbook.css html/
cp docbook.css html/
# store the documentation files
- name: Upload output directory
uses: actions/upload-artifact@v4
with:
name: doc-files
path: docs
retention-days: 1
copy:
name: Deploy documentation
runs-on: ubuntu-latest
needs: build
# The gh-pages branch exists only on the canonical repository, and the
# published docs track master; deploy only from master there.
if: github.repository == 'MobilityDB/MobilityDB-BerlinMOD' && github.ref == 'refs/heads/master'
steps:
# checkout the gh-pages branch
- uses: actions/checkout@v4
with:
ref: gh-pages
# download the doc files generated above, overwriting the tracked outputs
- name: Download output directory
uses: actions/download-artifact@v4
with:
name: doc-files
path: docs
# commit and push to gh-pages with plain git (no pull, so the overwritten
# binary outputs do not abort a merge)
- name: Commit changes
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs
git commit -m "Update docs" || { echo "No documentation changes"; exit 0; }
git push origin HEAD:gh-pages