|
| 1 | +name: Deploy Doxygen PDF and Update Docs |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: ["master"] |
| 5 | + |
| 6 | + workflow_dispatch: |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + id-token: write |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: "docs" |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v3 |
| 22 | + - uses: actions/setup-node@v3 |
| 23 | + with: |
| 24 | + node-version: 21 |
| 25 | + |
| 26 | + - name: Install JSDoc |
| 27 | + run: npm install -g jsdoc |
| 28 | + |
| 29 | + - name: Generate JSDoc |
| 30 | + run: jsdoc -c jsdoc.json |
| 31 | + |
| 32 | + - name: Copy JSDoc to output folder |
| 33 | + run: | |
| 34 | + mkdir jsdoc |
| 35 | + cp -r ./docs/ jsdoc/ |
| 36 | +
|
| 37 | + - name: Upload JSDoc |
| 38 | + uses: actions/upload-artifact@v4 |
| 39 | + with: |
| 40 | + name: JSDoc |
| 41 | + path: jsdoc/ |
| 42 | + |
| 43 | + - name: Install Doxygen |
| 44 | + run: sudo apt-get install -y doxygen |
| 45 | + |
| 46 | + - name: Install Graphviz |
| 47 | + run: sudo apt-get install -y graphviz |
| 48 | + |
| 49 | + - name: Run Doxygen |
| 50 | + run: doxygen Doxyfile |
| 51 | + |
| 52 | + - name: Generate PDF using LaTeX Action |
| 53 | + uses: xu-cheng/latex-action@v2 |
| 54 | + with: |
| 55 | + working_directory: docs/latex/ |
| 56 | + root_file: refman.tex |
| 57 | + |
| 58 | + - name: Copy PDF to more visible location in docs and output folder |
| 59 | + run: | |
| 60 | + mkdir doxygen |
| 61 | + cp ./docs/latex/refman.pdf ./docs/hivtrace-viz-doxygen-docs.pdf |
| 62 | + cp ./docs/latex/refman.pdf ./doxygen/hivtrace-viz-doxygen-docs.pdf |
| 63 | +
|
| 64 | + - name: Upload Doxygen Docs PDF |
| 65 | + uses: actions/upload-artifact@v4 |
| 66 | + with: |
| 67 | + name: Doxygen-PDF |
| 68 | + path: doxygen/hivtrace-viz-doxygen-docs.pdf |
| 69 | + |
| 70 | + - name: Push updated docs to master |
| 71 | + run: | |
| 72 | + git config --global user.name 'GitHub Actions' |
| 73 | + git config --global user.email '[email protected]' |
| 74 | + git add docs/ |
| 75 | +
|
| 76 | + # Check for changes |
| 77 | + if git diff-index --quiet HEAD --; then |
| 78 | + # No changes |
| 79 | + echo "No changes to commit" |
| 80 | + else |
| 81 | + # Changes detected |
| 82 | + git commit -m "Update JSDoc and Doxygen PDF" |
| 83 | + git push origin master |
| 84 | + fi |
0 commit comments