|
| 1 | + |
| 2 | +name: Deployment No Test |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + |
| 7 | + # Allows you to run this workflow manually from the Actions tab |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 11 | +jobs: |
| 12 | + |
| 13 | + build-docs: |
| 14 | + runs-on: ubuntu-latest |
| 15 | + steps: |
| 16 | + - uses: actions/checkout@v2 |
| 17 | + - name: Install dependencies |
| 18 | + run: pip install ".[docs]" |
| 19 | + - name: Build docs |
| 20 | + run: mkdocs build |
| 21 | + |
| 22 | + deploy-pypi: |
| 23 | + if: startsWith(github.ref, 'refs/tags') # tagged release |
| 24 | + needs: [build-docs] |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v2 |
| 28 | + |
| 29 | + - name: Build package |
| 30 | + run: | |
| 31 | + pip install --upgrade build |
| 32 | + python -m build |
| 33 | + - name: Release to PyPI |
| 34 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 35 | + with: |
| 36 | + user: __token__ |
| 37 | + password: ${{ secrets.PYPI_API_TOKEN }} |
| 38 | + verbose: true |
| 39 | + |
| 40 | + deploy-docs: |
| 41 | + if: startsWith(github.ref, 'refs/tags') # tagged release |
| 42 | + needs: [deploy-pypi] |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + |
| 47 | + - name: Install dependencies |
| 48 | + run: | |
| 49 | + # TODO: mhausenblas/mkdocs-deploy-gh-pages@nomaterial does not work with this: |
| 50 | + # pip install ".[docs]" |
| 51 | + # pip freeze > docs/requirements.txt |
| 52 | + # I'll manually list dependencies instead |
| 53 | + echo "mkdocs" >> requirements.txt |
| 54 | + echo "mkdocstrings[python]" >> requirements.txt |
| 55 | + echo "mkdocs-material" >> requirements.txt |
| 56 | + - name: Deploy docs |
| 57 | + uses: mhausenblas/mkdocs-deploy-gh-pages@master |
| 58 | + env: |
| 59 | + PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} |
| 60 | + REQUIREMENTS: docs/requirements.txt |
0 commit comments