summaryrefslogtreecommitdiff
path: root/.github/workflows/doxygen.yml
blob: 3428a9b55000e7fd0e3acf476d741b177f240e83 (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
63
64
65
66
67
68
69
name: Generate and Deploy Doxygen Documentation with m.css

on:
  push:
    branches:
      - master  # Replace with your default branch if different

jobs:
  build:
    runs-on: ubuntu-latest

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

      # Step 2: Install Doxygen, Python, and required dependencies
      - name: Install Dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y doxygen graphviz python3 python3-pip
          pip3 install --upgrade pip
          pip3 install git+https://github.com/mosra/m.css.git

      # Step 3: Download m.css theme
      - name: Download m.css
        run: |
          mkdir -p docs/m.css
          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 "EXTENSION_MAPPING = md=markdown" >> Doxyfile
          echo "MARKDOWN_SUPPORT = YES" >> Doxyfile

      # Step 5: Run Doxygen to generate raw HTML files
      - 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 \
            --input docs/html \
            --output docs/html \
            --site-root . \
            --deploy

      # 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