diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml new file mode 100644 index 0000000..cf694e2 --- /dev/null +++ b/.github/workflows/deploy-docs.yml @@ -0,0 +1,77 @@ +name: Deploy docs + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: ${{ github.workflow }}-${{ + github.event_name == 'pull_request' + && format('pr-{0}', github.event.number) + || github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake g++ pkg-config \ + zlib1g-dev libeigen3-dev libzip-dev \ + ninja-build doxygen + + - name: Install Python dependencies + run: python3 -m pip install -r docs/requirements.txt + + - name: Build docs + run: | + cmake -S . -B build -DTRX_BUILD_DOCS=ON + cmake --build build --target docs + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + name: ${{ github.event_name == 'pull_request' + && format('github-pages-preview-{0}', github.event.number) + || 'github-pages' }} + path: docs/_build/html + + deploy: + if: github.event_name != 'pull_request' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 + + deploy-preview: + if: github.event_name == 'pull_request' + needs: build + runs-on: ubuntu-latest + environment: + name: github-pages-preview-${{ github.event.number }} + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy PR preview + id: deployment + uses: actions/deploy-pages@v4 + with: + preview: true + artifact_name: github-pages-preview-${{ github.event.number }} diff --git a/.readthedocs.yaml b/.readthedocs.yaml deleted file mode 100644 index 3a6876b..0000000 --- a/.readthedocs.yaml +++ /dev/null @@ -1,29 +0,0 @@ -version: 2 - -build: - os: ubuntu-22.04 - tools: - python: "3.11" - apt_packages: - - cmake - - g++ - - pkg-config - - zlib1g-dev - - libeigen3-dev - - libzip-dev - - ninja-build - - zipcmp - - zipmerge - - ziptool - - jobs: - pre_build: - - cmake -S . -B build -DTRX_BUILD_DOCS=ON - - cmake --build build --target docs - -python: - install: - - requirements: docs/requirements.txt - -sphinx: - configuration: docs/conf.py diff --git a/README.md b/README.md index be71291..f6e30b0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # TRX-cpp -[![Documentation](https://readthedocs.org/projects/trx-cpp/badge/?version=latest)](https://trx-cpp.readthedocs.io/en/latest/) +[![Docs](https://img.shields.io/badge/docs-github.io-blue?style=flat&logo=github)](https://tee-ar-ex.github.io/trx-cpp/) [![codecov](https://codecov.io/gh/tee-ar-ex/trx-cpp/branch/main/graph/badge.svg)](https://codecov.io/gh/tee-ar-ex/trx-cpp) A C++17 library for reading, writing, and memory-mapping the [TRX tractography format](https://github.com/tee-ar-ex/trx-spec) — efficient storage for large-scale tractography data. @@ -39,11 +39,11 @@ auto positions = trx.positions.as_matrix(); // (NB_VERTICES, 3) trx.close(); ``` -See [Building](https://trx-cpp.readthedocs.io/en/latest/building.html) for platform-specific dependency installation and [Quick Start](https://trx-cpp.readthedocs.io/en/latest/quick_start.html) for a complete first program. +See [Building](https://tee-ar-ex.github.io/trx-cpp/building.html) for platform-specific dependency installation and [Quick Start](https://tee-ar-ex.github.io/trx-cpp/quick_start.html) for a complete first program. ## Documentation -Full documentation is at **[trx-cpp.readthedocs.io](https://trx-cpp.readthedocs.io/en/latest/)**. +Full documentation is at **[tee-ar-ex.github.io/trx-cpp](https://tee-ar-ex.github.io/trx-cpp/)**. ## Third-party notices diff --git a/docs/index.md b/docs/index.md index 5e157f4..1fe9b7a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,8 +1,8 @@ # TRX-cpp Documentation -```{image} https://readthedocs.org/projects/trx-cpp/badge/?version=latest +```{image} https://img.shields.io/badge/docs-github.io-blue?style=flat&logo=github :alt: Documentation Status -:target: https://trx-cpp.readthedocs.io/en/latest/ +:target: https://tee-ar-ex.github.io/trx-cpp/ ``` ```{image} https://codecov.io/gh/tee-ar-ex/trx-cpp/branch/main/graph/badge.svg