diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml new file mode 100644 index 00000000..e2b7507b --- /dev/null +++ b/.github/workflows/deploy-documentation.yml @@ -0,0 +1,39 @@ +--- +name: Deploy Docs to Github Pages +on: + workflow_run: + branches: [main] + workflows: [Test docs] + types: [completed] +concurrency: + group: publish-docs +jobs: + publish-docs: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} && github.ref == + 'refs/heads/main' + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Download Artifact + uses: dawidd6/action-download-artifact@v2.28.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + run_id: ${{ github.event.workflow_run.id }} + workflow_conclusion: success + name: artifact_docs + - name: Unzip Documentation Results + run: | + unzip docs_results.zip + rm -r docs_results/.results_docs/html/.doctrees + - name: Upload To Pages + uses: actions/upload-pages-artifact@v2 + with: + path: docs_results/.results_docs/html + - name: Deploy To Pages + uses: actions/deploy-pages@v2 + id: deployment diff --git a/README.rst b/README.rst index fd9da4cf..38d32042 100644 --- a/README.rst +++ b/README.rst @@ -19,7 +19,7 @@ * - Package - |PyPI: Package status| |PyPI: Latest release version| |PyPI: Supported Python versions| |PyPI: Downloads| |License: Apache 2.0| |Package build status| |PyPI upload status| |TestPyPI upload status| * - Documentation - - |Documentation status| + - |GitHub Pages status| * - Code Style - |Test style: pytest| |Code style: black| |Imports: isort| |Docstring style: google| * - Linting @@ -55,9 +55,12 @@ .. |pre-commit status| image:: https://results.pre-commit.ci/badge/github/tektronix/tm_devices/main.svg :target: https://results.pre-commit.ci/latest/github/tektronix/tm_devices/main -.. |Documentation status| image:: https://readthedocs.org/projects/tm-devices/badge/?version=latest +.. |ReadTheDocs status| image:: https://readthedocs.org/projects/tm-devices/badge/?version=latest :target: https://tm-devices.readthedocs.io/en/latest/?badge=latest +.. |GitHub Pages status| image:: https://github.com/tektronix/tm_devices/actions/workflows/deploy-documentation.yml/badge.svg?branch=main + :target: https://github.com/tektronix/tm_devices/actions/workflows/deploy-documentation.yml + .. |License: Apache 2.0| image:: https://img.shields.io/pypi/l/tm_devices :target: https://tinyurl.com/tek-tm-devices/LICENSE.md @@ -257,7 +260,7 @@ Supported Connections Documentation ------------- -See the full documentation at ``__ +See the full documentation at ``__ Maintainers ----------- diff --git a/pyproject.toml b/pyproject.toml index dc51d565..4c760ba6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,7 @@ classifiers = [ "Programming Language :: Python :: 3.12" # TODO: remove this once poetry automatically adds it ] description = "Manage connections and interactions with Test & Measurement devices." -documentation = "https://tm-devices.readthedocs.io/en/latest/" +documentation = "https://tektronix.github.io/tm_devices/" homepage = "https://pypi.org/project/tm_devices/" keywords = [ "REST API",