Add redirect stuff to conf.py #19
This file contains hidden or 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: Documentation | |
| on: | |
| push: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: docs-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| FORCE_COLOR: 1 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install the latest version of uv | |
| uses: astral-sh/setup-uv@v6 | |
| - name: Install dependencies | |
| run: uv sync --group doc | |
| - name: Install just | |
| uses: extractions/setup-just@v3 | |
| - name: Restore TorchIO cached data | |
| id: cache-torchio-data-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: ~/.cache/torchio | |
| key: ${{ runner.os }}-torchio-data | |
| - name: Build docs | |
| run: just build-docs | |
| - name: Save TorchIO cached data | |
| if: steps.cache-torchio-data-restore.outputs.cache-hit != 'true' | |
| id: cache-torchio-data-save | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/torchio | |
| key: ${{ steps.cache-torchio-data-restore.outputs.cache-primary-key }} | |
| # Uploade to smokeshow if not on main branch | |
| - name: Upload docs to smokeshow | |
| if: github.ref != 'refs/heads/main' | |
| run: | | |
| rm ./docs/build/html/_images/*.gif | |
| rm ./docs/build/html/_images/*.png | |
| uvx smokeshow upload ./docs/build/html | |
| # Upload to GitHub Pages if on main branch | |
| - name: Upload artifacts using actions/upload-pages-artifact | |
| if: github.ref == 'refs/heads/main' | |
| id: deployment | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./docs/build/html | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| needs: build | |
| # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| permissions: | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| runs-on: ubuntu-latest | |
| # Deploy to the github-pages environment | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |