Skip to content

Set up multi-version docs #2089

Set up multi-version docs

Set up multi-version docs #2089

name: Build Sphinx docs and deploy to GitHub Pages
# Generate the documentation on all merges to main, all pull requests, or by
# manual workflow dispatch. The build job can be used as a CI check that the
# docs still build successfully. The deploy job only runs when a tag is
# pushed and actually moves the generated html to the gh-pages branch
# (which triggers a GitHub pages deployment).
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
workflow_dispatch:
jobs:
build_sphinx_docs:
name: Build Sphinx Docs
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/build_sphinx_docs@main
with:
use-artifactci: lazy
deploy_sphinx_docs:
name: Deploy Sphinx Docs
needs: build_sphinx_docs
permissions:
contents: write
# runs on releases, push to main, or manual dispatch on main
if: |
(github.event_name == 'push' && github.ref_type == 'tag') ||
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- uses: neuroinformatics-unit/actions/deploy_sphinx_docs_multiversion@main
with:
secret_input: ${{ secrets.GITHUB_TOKEN }}
switcher-url: https://datashuttle.neuroinformatics.dev/latest/_static/switcher.json