File: docs.yml

package info (click to toggle)
pencil2d 0.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,752 kB
  • sloc: cpp: 59,293; xml: 361; makefile: 8
file content (69 lines) | stat: -rw-r--r-- 2,894 bytes parent folder | download | duplicates (2)
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
name: Documentation Update

on:
  push: { branches: [ master ] }

jobs:
  ghp:
    name: GitHub Pages
    if: github.repository_owner == 'pencil2d'
    runs-on: ubuntu-latest

    steps:
    - name: Check out Pencil2D source code
      uses: actions/checkout@v2
    - name: Check out the documentation repository
      uses: actions/checkout@v2
      with:
        repository: pencil2d/pencil-docs
        token: ${{secrets.docs_repo_token}}
        path: gh-pages

    - name: Install dependencies
      run: |
        sudo apt-get update -yq
        sudo apt-get install -yq --no-install-suggests --no-install-recommends graphviz fonts-open-sans xsltproc
        curl -fsSLO https://www.doxygen.nl/files/doxygen-1.9.6.linux.bin.tar.gz
        tar xf doxygen-1.9.6.linux.bin.tar.gz
        realpath doxygen-1.9.6/bin >> "${GITHUB_PATH}"

    - name: Retrieve Qt tagfiles
      working-directory: util/docs
      run: |
        for i in core gui network svg testlib widgets xml; do
          curl -fsSLO "https://doc.qt.io/qt-5/qt${i}.tags"
        done

    - name: Generate documentation
      run: |
        echo PROJECT_NUMBER=${{github.sha}} >> Doxyfile
        echo LAYOUT_FILE=util/docs/layout.xml >> Doxyfile
        echo HTML_HEADER=util/docs/header.html >> Doxyfile
        echo HTML_FOOTER=util/docs/footer.html >> Doxyfile
        echo HTML_EXTRA_STYLESHEET=util/docs/extra.css >> Doxyfile
        echo HAVE_DOT=YES >> Doxyfile
        echo DOT_COMMON_ATTR=\"fontname=\\\"Open Sans\\\",fontsize=13.2\" >> Doxyfile
        echo DOT_EDGE_ATTR=\"labelfontname=\\\"Open Sans\\\",labelfontsize=13.2\" >> Doxyfile
        doxygen 2>&1 | tee doxygen.log
        if [ ! -f "docs/html/index.html" ]; then
          echo "::error::Documentation output was not found"
          exit 1
        fi
        xsltproc --novalid -o docs/html/404.html util/docs/404.xsl docs/html/index.html
        # Doxygen's search results positioning code is buggy and doesn't consider scrollbars
        sed -i 's/left -= domPopupSearchResults.offsetWidth;/left -= domPopupSearchResults.offsetWidth - domPopupSearchResultsWindow.clientWidth - parseFloat(getComputedStyle(domPopupSearchResultsWindow).borderLeftWidth) - parseFloat(getComputedStyle(domPopupSearchResultsWindow).borderRightWidth) + domPopupSearchResultsWindow.offsetWidth;/' docs/html/search/search.js

    - name: Remove old documentation
      run: |
        mv gh-pages/docs/CNAME docs/html/
        rm -rf gh-pages/docs/
    - name: Push updated documentation
      working-directory: gh-pages
      run: |
        mv ../doxygen.log .
        mv ../docs/html docs
        git add --all
        git config user.name "GitHub Actions"
        git config user.email "actions@github.com"
        git commit -m "Add generated docs for rev ${{github.repository}}@${{github.sha}}" -m "Generated in Actions run #${{github.run_number}}"
        git push