deploy_doc.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. name: Build Documentation
  2. concurrency:
  3. group: ${{ github.workflow }}-${{ github.ref }}
  4. cancel-in-progress: true
  5. on:
  6. push:
  7. paths:
  8. - "doc/**"
  9. - ".github/**"
  10. - ".ci/**"
  11. pull_request:
  12. paths:
  13. - "doc/**"
  14. - ".github/**"
  15. - ".ci/**"
  16. jobs:
  17. build_deploy:
  18. name: Build documentation
  19. runs-on: ${{ matrix.os }}
  20. strategy:
  21. matrix:
  22. os: [ubuntu-22.04]
  23. steps:
  24. - uses: actions/checkout@v4
  25. with:
  26. submodules: recursive
  27. fetch-depth: 0
  28. - name: Install Dependencies on Ubuntu
  29. if: startsWith(matrix.os, 'ubuntu')
  30. run: |
  31. sudo apt-get update
  32. sudo apt-get install lftp python3 make latexmk \
  33. texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended
  34. sudo python3 -m pip install --upgrade pip
  35. sudo pip3 install -r doc/requirements.txt
  36. - name: Build Documentation
  37. run: |
  38. cd doc
  39. make all
  40. make latexpdf
  41. cp build/latex/*.pdf build/html/
  42. cd ..
  43. - name: Deploy Documentation
  44. if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/master' }}
  45. env:
  46. FTPUSER: ${{ secrets.FTPUSER }}
  47. FTPPWD: ${{ secrets.FTPPWD }}
  48. FTPSERVER: ${{ secrets.FTPSERVER }}
  49. run: |
  50. bash .ci/ftp_deploy.sh $FTPUSER $FTPPWD $FTPSERVER doc/build/html nuclei_sdk
  51. - name: Upload Documentation
  52. uses: actions/upload-artifact@v4
  53. with:
  54. # Artifact name
  55. name: nuclei_sdk_doc
  56. # A file, directory or wildcard pattern that describes what to upload
  57. path: doc/build/html