|
| 1 | +# Copyright (c) 2016-2023 Martin Donath <[email protected]> |
| 2 | + |
| 3 | +# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | +# of this software and associated documentation files (the "Software"), to |
| 5 | +# deal in the Software without restriction, including without limitation the |
| 6 | +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 7 | +# sell copies of the Software, and to permit persons to whom the Software is |
| 8 | +# furnished to do so, subject to the following conditions: |
| 9 | + |
| 10 | +# The above copyright notice and this permission notice shall be included in |
| 11 | +# all copies or substantial portions of the Software. |
| 12 | + |
| 13 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 18 | +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
| 19 | +# IN THE SOFTWARE. |
| 20 | + |
| 21 | +name: documentation |
| 22 | +on: |
| 23 | + push: |
| 24 | + branches: |
| 25 | + - master |
| 26 | + |
| 27 | +env: |
| 28 | + PYTHON_VERSION: 3.x |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: write |
| 32 | + |
| 33 | +jobs: |
| 34 | + documentation: |
| 35 | + name: Build documentation |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + |
| 39 | + - name: Checkout repository |
| 40 | + uses: actions/checkout@v3 |
| 41 | + with: |
| 42 | + fetch-depth: 0 |
| 43 | + |
| 44 | + - name: Set up Python runtime |
| 45 | + uses: actions/setup-python@v4 |
| 46 | + with: |
| 47 | + python-version: ${{ env.PYTHON_VERSION }} |
| 48 | + |
| 49 | + - name: Set the date environmental variable |
| 50 | + run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV |
| 51 | + |
| 52 | + - name: Set up build cache |
| 53 | + uses: actions/cache@v3 |
| 54 | + id: cache |
| 55 | + with: |
| 56 | + key: mkdocs-material-${{ env.cache_id }} |
| 57 | + path: .cache |
| 58 | + restore-keys: | |
| 59 | + mkdocs-material- |
| 60 | +
|
| 61 | + - name: Install dependencies |
| 62 | + run: sudo apt-get install pngquant |
| 63 | + |
| 64 | + - name: Install Python dependencies |
| 65 | + run: pip install -r requirements.txt |
| 66 | + |
| 67 | + - name: Install Insiders |
| 68 | + if: github.event.repository.fork == false |
| 69 | + env: |
| 70 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 71 | + run: | |
| 72 | + pip install git+https://${GH_TOKEN}@github.com/squidfunk/mkdocs-material-insiders.git |
| 73 | +
|
| 74 | + - name: Deploy documentation |
| 75 | + env: |
| 76 | + GH_TOKEN: ${{ secrets.GH_TOKEN }} |
| 77 | + PYTHONPATH: . |
| 78 | + # GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} |
| 79 | + run: | |
| 80 | + mkdocs gh-deploy --force |
| 81 | + mkdocs --version |
0 commit comments