summaryrefslogtreecommitdiff
path: root/.github/workflows/doxygen.yml
blob: d4ab573688d3cf9113e7ceca9f2e63d8e9d7de80 (plain)
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
name: Generate and Deploy Doxygen Documentation with m.css

on:
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      # Step 1: Checkout the repository
      - name: Checkout Repository
        uses: actions/checkout@v3

      # Step 2: Install Doxygen and Python
      - name: Install Doxygen and Python
        run: |
          sudo apt-get update
          sudo apt-get install -y doxygen graphviz python3 python3-pip

      # Step 3: Clone m.css repository
      - name: Clone m.css
        run: |
          git clone --depth 1 https://github.com/mosra/m.css.git docs/m.css

      # Step 4: Create Doxyfile
      - name: Create Doxyfile
        run: |
          echo "PROJECT_NAME = fbgl" > Doxyfile
          echo "PROJECT_NUMBER = 0.1.0" >> Doxyfile
          echo "OUTPUT_DIRECTORY = docs" >> Doxyfile
          echo "INPUT = fbgl.h README.md" >> Doxyfile
          echo "USE_MDFILE_AS_MAINPAGE = README.md" >> Doxyfile
          echo "FILE_PATTERNS = *.h *.md" >> Doxyfile
          echo "RECURSIVE = NO" >> Doxyfile
          echo "GENERATE_HTML = YES" >> Doxyfile
          echo "HTML_OUTPUT = html" >> Doxyfile
          echo "GENERATE_LATEX = NO" >> Doxyfile
          echo "GENERATE_MAN = NO" >> Doxyfile
          echo "GENERATE_RTF = NO" >> Doxyfile
          echo "QUIET = YES" >> Doxyfile
          echo "MARKDOWN_SUPPORT = YES" >> Doxyfile
          echo "HTML_EXTRA_FILES = docs/m.css/js/m.js docs/m.css/js/m-search.js docs/m.css/css/m-components.css docs/m.css/css/m-layout.css docs/m.css/css/m-style.css docs/m.css/css/m-theme.css" >> Doxyfile

      # Step 5: Run Doxygen
      - name: Run Doxygen
        run: doxygen Doxyfile

      # Step 6: Process HTML with m.css
      - name: Apply m.css
        run: |
          python3 docs/m.css/documentation/doxygen.py Doxyfile

      # Step 7: Deploy to GitHub Pages
      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v4
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: docs/html
          publish_branch: gh-pages