ci: add job to generate docs (MR 2266)
This commit is contained in:
parent
974b76c00a
commit
d28174bf95
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh -e
|
||||
# Description: create documentation with sphinx
|
||||
# Options: native
|
||||
# https://postmarketos.org/pmb-ci
|
||||
|
||||
|
||||
# Ensure sphinx_rtd_theme is installed
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
set -x
|
||||
apk -q add \
|
||||
py3-sphinx_rtd_theme \
|
||||
py3-sphinxcontrib-autoprogram
|
||||
exec su "${TESTUSER:-build}" -c "sh -e $0"
|
||||
fi
|
||||
|
||||
# Require sphinx to be installed on the host system
|
||||
if [ -z "$(command -v sphinx-build)" ]; then
|
||||
echo "ERROR: sphinx-build command not found, make sure it is in your PATH."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sphinx-build \
|
||||
docs \
|
||||
public \
|
||||
|
||||
# -E -a -v -T
|
|
@ -19,6 +19,7 @@ __pycache__/
|
|||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
public/
|
||||
env/
|
||||
develop-eggs/
|
||||
dist/
|
||||
|
|
|
@ -8,6 +8,7 @@ workflow:
|
|||
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
||||
- if: $CI_COMMIT_BRANCH == 'master'
|
||||
- if: $CI_COMMIT_BRANCH == 'wip'
|
||||
- if: $CI_COMMIT_BRANCH == 'docs'
|
||||
|
||||
before_script: &global_before_scripts
|
||||
- ".ci/note.sh"
|
||||
|
@ -62,3 +63,12 @@ mypy:
|
|||
stage: lint
|
||||
script:
|
||||
- ".ci/mypy.sh"
|
||||
|
||||
docs:
|
||||
stage: lint
|
||||
script:
|
||||
- apk add py3-sphinx py3-sphinx_rtd_theme
|
||||
- ".ci/docs.sh"
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
|
|
Loading…
Reference in New Issue