docs.yml 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. name: Docs
  2. on: [push, pull_request]
  3. jobs:
  4. Salt:
  5. name: Build Salt Documentation
  6. runs-on: ubuntu-latest
  7. container:
  8. image: python:3.8.6-slim-buster
  9. steps:
  10. - name: Install System Deps
  11. run: |
  12. apt-get update
  13. apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev xz-utils
  14. - uses: actions/checkout@v2
  15. - name: Set Python Version Env Var
  16. run: |
  17. echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV
  18. - name: Install Nox
  19. run: |
  20. python -m pip install --upgrade pip
  21. pip install nox
  22. - id: changed-files
  23. name: Get Changed Files
  24. uses: dorny/paths-filter@v2
  25. with:
  26. token: ${{ github.token }}
  27. list-files: json
  28. filters: |
  29. docs:
  30. - docs/**
  31. - name: Set Docs Python Cache Key
  32. run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
  33. - name: Setup Nox Cache
  34. uses: pat-s/always-upload-cache@v2.1.3
  35. with:
  36. path: .nox/
  37. key: docs-salt|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}
  38. - name: Install Python Requirements
  39. env:
  40. PIP_EXTRA_INDEX_URL: https://artifactory.saltstack.net/artifactory/api/pypi/pypi-open/simple/
  41. run:
  42. nox --install-only --forcecolor -e 'docs-html(compress=False, clean=True)'
  43. - name: Build Docs
  44. env:
  45. SKIP_REQUIREMENTS_INSTALL: YES
  46. run: |
  47. nox --forcecolor -e 'docs-html(compress=False, clean=True)'
  48. - name: Store Generated Documentation
  49. uses: actions/upload-artifact@v2
  50. with:
  51. name: salt-html-docs
  52. path: doc/_build/html
  53. Manpages:
  54. name: Build Salt man Pages
  55. runs-on: ubuntu-latest
  56. container:
  57. image: python:3.8.6-slim-buster
  58. steps:
  59. - name: Install System Deps
  60. run: |
  61. apt-get update
  62. apt-get install -y enchant git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev
  63. - uses: actions/checkout@v2
  64. - id: changed-files
  65. name: Get Changed Files
  66. uses: dorny/paths-filter@v2
  67. with:
  68. token: ${{ github.token }}
  69. list-files: json
  70. filters: |
  71. docs:
  72. - docs/**
  73. - name: Set Python Version Env Var
  74. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  75. run: |
  76. echo PY_VERSION=$(python -c 'import sys; print("{}.{}".format(*sys.version_info))') >> $GITHUB_ENV
  77. - name: Install Nox
  78. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  79. run: |
  80. python -m pip install --upgrade pip
  81. pip install nox
  82. - name: Set Docs Python Cache Key
  83. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  84. run: echo "PY=$(python --version --version | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
  85. - name: Setup Nox Cache
  86. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  87. uses: pat-s/always-upload-cache@v2.1.3
  88. with:
  89. path: .nox/
  90. key: docs-man|${{ env.PY }}|${{ hashFiles(format('requirements/static/ci/py{0}/*.txt', env.PY_VERSION)) }}
  91. - name: Install Python Requirements
  92. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  93. env:
  94. PIP_EXTRA_INDEX_URL: https://artifactory.saltstack.net/artifactory/api/pypi/pypi-open/simple/
  95. run:
  96. nox --install-only --forcecolor -e 'docs-man(compress=False, update=False, clean=True)'
  97. - name: Build Manpages
  98. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  99. env:
  100. SKIP_REQUIREMENTS_INSTALL: YES
  101. run: |
  102. nox --forcecolor -e 'docs-man(compress=False, update=False, clean=True)'
  103. - name: Store Generated Documentation
  104. if: github.event_name == 'push' || steps.changed-files.outputs.docs == 'true'
  105. uses: actions/upload-artifact@v2
  106. with:
  107. name: salt-man-pages
  108. path: doc/_build/man