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
|
# Automatic generation of documentation will be copied and checked into the
# gh-pages branch.
name: Generate MobilityDB documentation
on:
workflow_dispatch:
push:
paths:
- '.github/workflows/generate_docs.yml'
- 'doc/**'
branches:
- 'master'
- 'stable-[0-9]+.[0-9]+'
jobs:
build:
name: Generate documentation
runs-on: ubuntu-latest
steps:
# checkout branch
- name: Checkout repository
uses: actions/checkout@v4
with:
sparse-checkout: doc
# Install dblatex
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y dblatex dbtoepub xsltproc texlive-lang-spanish
# generate the documentation files
- name: Generate English documentation
run: |
cd doc
dblatex -s texstyle.sty -o mobilitydb-manual.pdf mobilitydb-manual.xml
dbtoepub -o mobilitydb-manual.epub mobilitydb-manual.xml
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-manual.xml
# generate the documentation files
- name: Generate Spanish documentation
run: |
cd doc
dblatex -s texstyle.sty -o es/mobilitydb-manual.pdf es/mobilitydb-manual.xml
dbtoepub -o es/mobilitydb-manual.epub es/mobilitydb-manual.xml
xsltproc --stringparam html.stylesheet "docbook.css" --stringparam chunker.output.encoding "UTF-8" --xinclude -o es/index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl es/mobilitydb-manual.xml
cp docbook.css es/
# store the documentation files
- name: Upload output directory
uses: actions/upload-artifact@v4
with:
name: doc-files
path: |
doc/images/*
doc/mobilitydb-manual.pdf
doc/mobilitydb-manual.epub
doc/docbook.css
doc/*.html
doc/es/mobilitydb-manual.pdf
doc/es/mobilitydb-manual.epub
doc/es/docbook.css
doc/es/*.html
retention-days: 1
copy:
name: Deploy documentation
runs-on: ubuntu-latest
needs: build
steps:
# checkout the gh-pages branch
- uses: actions/checkout@v4
with:
ref: gh-pages
# download the doc files, most of which are generated above
- name: Download output directory
uses: actions/download-artifact@v4
with:
name: doc-files
path: docs-temp
# Rename the directory to branch name
- name: Rename the directory to branch name
run: |
rm -rf ${{ github.ref_name }}
mv docs-temp ${{ github.ref_name }}
# add, commit and push to gh-pages
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
message: 'Update docs'
default_author: github_actions
|