Docs #2
This file contains 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
# SPDX-License-Identifier: BSD-3-Clause | |
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp) | |
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 | |
linkcheck: | |
description: 'Run the link checker. If not set the link checker will not be run.' | |
default: false | |
required: false | |
type: boolean | |
env: | |
VERSION: ${{ inputs.version }} | |
jobs: | |
docs: | |
name: Build documentation | |
runs-on: 'ubuntu-22.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@v4 | |
with: | |
python-version-file: '.github/workflows/python-version-ci' | |
- run: python -m pip install --upgrade pip | |
- run: python -m pip install -r requirements/ci.txt | |
- run: tox -e releasedocs -- ${VERSION} | |
if: ${{ inputs.version != '' }} | |
- run: tox -e docs | |
if: ${{ inputs.version == '' }} | |
- run: tox -e linkcheck | |
if: ${{ inputs.linkcheck }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: docs_html | |
path: html/ | |
- uses: JamesIves/[email protected] | |
if: ${{ inputs.publish }} | |
with: | |
branch: gh-pages | |
folder: html | |
single-commit: true |