build: added dependabot-uv workflow #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: docs | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# manual | |
workflow_dispatch: | |
UV_VERSION: 0.4.25 | |
env: | |
PRE_COMMIT_CACHE: ~/.cache/pre-commit | |
jobs: | |
tox-docs: | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.11" | |
os: [ubuntu-latest] | |
env: | |
- TOXENV: "docs" | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
version: ${{ env.UV_VERSION }} | |
enable-cache: true | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox==4.18.1 tox-gh | |
- name: Cache pre-commit | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.PRE_COMMIT_CACHE }} | |
key: ${{ matrix.os }}-${{ matrix.python-version }}-pre-commit-${{ hashFiles('uv.lock') }} | |
- name: Run tox | |
run: | | |
tox | |
shell: bash | |
env: ${{ matrix.env }} | |
- name: Prepare docs artifact | |
if: always() | |
shell: bash | |
run: | | |
mkdir artifact | |
cp -a .tox/docs_out/ artifact/html_docs | |
- name: Upload docs artifact | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: html_docs | |
path: ./artifact | |
- name: Deploy to gh pages | |
if: ${{ github.event_name == 'push' && github.ref_name == github.event.repository.default_branch }} | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: .tox/docs_out/ | |
destination_dir: ./latest |