diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3002412..010c7878 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,3 +47,6 @@ jobs: with: parallel-finished: true base-path: tika + + docs: + uses: ./.github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index a76160ab..bfc87fc0 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -2,18 +2,14 @@ name: Documentation on: - # Runs on pushes targeting the default branch push: branches: ["master"] - + workflow_call: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: write - pages: write - id-token: write +# Set permissions at the job level. +permissions: {} # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. @@ -22,32 +18,55 @@ concurrency: cancel-in-progress: false jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest + build: + runs-on: ubuntu-slim steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install dependencies - run: | + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + cache: 'pip' + + - run: | python -m pip install --upgrade pip python -m pip install . --group=docs - - name: Sphinx APIDoc - run: | - sphinx-apidoc -f -o docs/source/ . - - name: Sphinx build - run: | - sphinx-build -b html docs/source/ docs/build/html - - name: Setup Pages - uses: actions/configure-pages@v5 + python -m pip list + + - run: | + sphinx-build --builder html docs/source/ docs/build/html + - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v4 with: - # Upload entire repository + name: docs-html path: './docs/build/html' + + deploy: + needs: build + # Deploy only on push to master + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-slim + steps: + # - name: Download HTML artifact + # uses: actions/download-artifact@v4 + # with: + # name: docs-html + # path: docs/build/html + + # - name: Setup Pages + # uses: actions/configure-pages@v5 + + # - name: Upload Pages artifact + # uses: actions/upload-pages-artifact@v4 + # with: + # path: docs/build/html + - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/docs/source/conf.py b/docs/source/conf.py index 52d5608f..8147ed83 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,9 +11,9 @@ # Add the parent directory of the documentation root to sys.path sys.path.insert(0, os.path.abspath("../..")) -project = 'tika-python' -copyright = '2024, Chris A. Mattmann' -author = 'Chris A. Mattmann' +project = "tika-python" +copyright = "2024, Chris A. Mattmann" +author = "Chris A. Mattmann" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -26,16 +26,34 @@ "sphinx.ext.autosectionlabel", "sphinx.ext.todo", "sphinx.ext.duration", - "myst_parser" + "myst_parser", ] -templates_path = ['_templates'] -exclude_patterns = ['tika.tests*'] - +templates_path = ["_templates"] +exclude_patterns = ["tika.tests*"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'furo' -html_static_path = ['_static'] +html_theme = "furo" +html_static_path = ["_static"] +html_theme_options = { + "source_repository": "https://github.com/chrismattmann/tika-python", + "source_branch": "master", + "source_directory": "docs/source/", + "footer_icons": [ + { + "name": "GitHub", + "url": "https://github.com/chrismattmann/tika-python", + # Embedded SVG instructions from furo docs + # Ref: https://pradyunsg.me/furo/customisation/footer/#configuration + "html": """ + + + + """, + "class": "", + }, + ], +} diff --git a/docs/source/readme.rst b/docs/source/readme.rst deleted file mode 100644 index 13e17467..00000000 --- a/docs/source/readme.rst +++ /dev/null @@ -1,5 +0,0 @@ -README.md -========== - -.. include:: ../../README.md - :parser: myst_parser.sphinx_ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 19eda958..d1e3f28f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ docs = [ [project.urls] homepage = "http://github.com/chrismattmann/tika-python" repository = "http://github.com/chrismattmann/tika-python.git" +documentation = "https://chrismattmann.github.io/tika-python" [project.scripts] tika-python = "tika.tika:main"