Generate documentation automatically #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Automatic generation of documentation will be copied and checked into the | |
# gh-pages branch. | |
name: Documentation generation CI | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Generate documentation | |
runs-on: ubuntu-latest | |
steps: | |
# checkout branch | |
- uses: actions/checkout@v3 | |
# 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 mobilitydb-workshop.xml | |
dbtoepub -o mobilitydb-workshop.epub mobilitydb-workshop.xml | |
xsltproc --stringparam html.stylesheet "docbook.css" --xinclude -o index.html /usr/share/xml/docbook/stylesheet/docbook-xsl/html/chunk.xsl mobilitydb-workshop.xml | |
# store the documentation files | |
- name: Upload Output Directory | |
uses: actions/upload-artifact@v2 | |
with: | |
name: doc-files | |
path: docs | |
retention-days: 1 | |
copy: | |
name: Deploy documentation | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
# checkout the gh-pages branch | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
# download the doc files, most of which are generated above | |
- name: Download Output Directory | |
uses: actions/download-artifact@v2 | |
with: | |
name: doc-files | |
path: docs | |
# add, commit and push to gh-pages | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v7 | |
with: | |
message: 'Update docs' | |
branch: gh-pages | |
add: '["docs/mobilitydb-workshop.pdf", | |
"docs/mobilitydb-workshop.epub", | |
"docs/images/*", | |
"docs/*.html"]' | |