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