| 1 | name: deploy |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | tags: |
| 6 | - '*' |
| 7 | |
| 8 | jobs: |
| 9 | |
| 10 | documents: |
| 11 | strategy: |
| 12 | max-parallel: 4 |
| 13 | matrix: |
| 14 | python-version: [3.11] |
| 15 | |
| 16 | runs-on: ubuntu-latest |
| 17 | |
| 18 | steps: |
| 19 | - uses: actions/checkout@v2 |
| 20 | with: |
| 21 | fetch-depth: 0 |
| 22 | - name: Set up Python ${{ matrix.python-version }} |
| 23 | uses: actions/setup-python@v2 |
| 24 | with: |
| 25 | python-version: ${{ matrix.python-version }} |
| 26 | - name: Install dependencies |
| 27 | run: | |
| 28 | python -m pip install --upgrade pip setuptools build |
| 29 | python -m pip install -r requirements/docs.txt |
| 30 | - name: Deploy documents |
| 31 | run: | |
| 32 | git config user.name facelessuser |
| 33 | git config user.email "${{ secrets.GH_EMAIL }}" |
| 34 | git remote add gh-token "https://${{ secrets.GH_TOKEN }}@github.com/facelessuser/bracex.git" |
| 35 | git fetch gh-token && git fetch gh-token gh-pages:gh-pages |
| 36 | python -m mkdocs gh-deploy -v --clean --remote-name gh-token |
| 37 | git push gh-token gh-pages |
| 38 | |
| 39 | pypi: |
| 40 | runs-on: ubuntu-latest |
| 41 | |
| 42 | steps: |
| 43 | - uses: actions/checkout@v3 |
| 44 | - uses: actions/setup-python@v4 |
| 45 | with: |
| 46 | python-version: 3.11 |
| 47 | - name: Package |
| 48 | run: | |
| 49 | pip install --upgrade wheel build |
| 50 | python -m build -s -w |
| 51 | - name: Publish |
| 52 | uses: pypa/gh-action-pypi-publish@release/v1 |
| 53 | with: |
| 54 | user: __token__ |
| 55 | password: ${{ secrets.PYPI_PWD }} |