doc: fix short underline #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: Build and deploy documentation | |
| on: | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Pixi | |
| uses: prefix-dev/setup-pixi@v0 | |
| with: | |
| cache: true | |
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| frozen: true | |
| environments: docs | |
| - name: Build documentation | |
| run: SPHINXOPTS="-W" pixi run -e docs build-docs | |
| - name: Upload built documentation | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docs-html | |
| path: docs/_build/html | |
| - name: Prepare gh-pages worktree | |
| if: github.repository == 'nipreps/dmriprep' | |
| run: | | |
| git fetch origin gh-pages:gh-pages | |
| git worktree add site gh-pages | |
| - name: Ensure .nojekyll | |
| if: github.repository == 'nipreps/dmriprep' | |
| run: | | |
| touch site/.nojekyll | |
| - name: Deploy master documentation | |
| if: github.repository == 'nipreps/dmriprep' && github.ref == 'refs/heads/master' | |
| run: | | |
| mkdir -p site/master | |
| rsync -a --delete docs/_build/html/ site/master/ | |
| - name: Deploy tagged documentation | |
| if: github.repository == 'nipreps/dmriprep' && github.ref_type == 'tag' | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| dest="site/${REF_NAME}" | |
| if [ -e "${dest}" ]; then | |
| echo "Documentation for ${REF_NAME} already exists" | |
| exit 1 | |
| fi | |
| mkdir -p "${dest}" | |
| rsync -a docs/_build/html/ "${dest}/" | |
| - name: Check for site changes | |
| if: github.repository == 'nipreps/dmriprep' | |
| id: site_changes | |
| run: | | |
| cd site | |
| if [ -n "$(git status --short)" ]; then | |
| echo "changes=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changes=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Commit changes | |
| if: github.repository == 'nipreps/dmriprep' && steps.site_changes.outputs.changes == 'true' | |
| env: | |
| REF_NAME: ${{ github.ref_name }} | |
| run: | | |
| cd site | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "docs: update for ${REF_NAME}" | |
| - name: Log summary | |
| if: github.repository == 'nipreps/dmriprep' && steps.site_changes.outputs.changes == 'true' | |
| run: | | |
| git -C site log -1 --stat | |
| - name: Push changes | |
| if: github.repository == 'nipreps/dmriprep' && steps.site_changes.outputs.changes == 'true' | |
| run: | | |
| git -C site push origin gh-pages |