Skip to content

Docs

Docs #15

Workflow file for this run

name: Docs
on:
workflow_dispatch:
inputs:
publish:
default: false
type: boolean
version:
default: ''
required: false
type: string
branch:
description: 'Branch/tag with documentation source. If not set, the current branch will be used.'
default: ''
required: false
type: string
workflow_call:
inputs:
publish:
default: false
type: boolean
version:
default: ''
required: false
type: string
branch:
description: 'Branch/tag with documentation source. If not set, the current branch will be used.'
default: ''
required: false
type: string
env:
VERSION: ${{ inputs.version }}
jobs:
docs:
name: Build documentation
runs-on: ubuntu-20.04
steps:
- run: sudo apt install --yes graphviz pandoc
- uses: actions/checkout@v3
with:
ref: ${{ inputs.branch == '' && github.ref_name || inputs.branch }}
fetch-depth: 0 # history required so cmake can determine version
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- run: |
tox --skip-pkg-install -e docs -- scippnexus==${VERSION}
echo "target=$(python docs/version.py --version=${VERSION} --action=get-target)" >> $GITHUB_ENV
if: ${{ inputs.publish }}
- run: tox -e docs
if: ${{ !inputs.publish }}
- uses: actions/upload-artifact@v3
with:
name: html
path: html/
- uses: JamesIves/[email protected]
if: ${{ inputs.publish }}
with:
branch: gh-pages
folder: html
target-folder: ${{ env.target }}
single-commit: true
clean-exclude: release
ssh-key: ${{ secrets.GH_PAGES_DEPLOY_KEY }}