Project CD/CD Workflows #6
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: Project CD/CD Workflows | |
on: | |
push: | |
tags: | |
- "v*" | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
setup-uv: | |
name: Install uv, Python & dependencies | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.5.16" | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install Dependencies | |
run: uv sync --all-extras --dev | |
- name: Ruff Lint | |
run: uv run ruff check --output-format=github | |
- name: Ruff Format | |
run: uv run ruff format --diff | |
# - name: Enable Caching | |
# uses: astral-sh/setup-uv@v5 | |
# with: | |
# enable-cache: true | |
# cache-dependency-glob: "uv.lock" | |
setup-sphinx: | |
name: Build Sphinx documentation | |
runs-on: ubuntu-latest | |
needs: setup-uv | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
version: "0.5.16" | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version-file: "pyproject.toml" | |
- name: Install Dependencies | |
run: uv sync --all-extras --no-dev | |
- name: Make HTML | |
run: | | |
cd docs | |
make html | |
- name: Upload HTML Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/build/html | |
deploy-sphinx: | |
name: Deploy Sphinx documentation | |
environment: | |
name: github-pages | |
url: ${{ steps.github-pages-deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: [setup-uv, setup-sphinx] | |
steps: | |
- name: GitHub Pages | |
id: github-pages-deployment | |
uses: actions/deploy-pages@v4 |