streamlink/netlify.toml

42 lines
1.8 KiB
TOML

# Streamlink documentation preview config for pull requests via netlify.com
# Some settings like PR statuses for example can only be configured via the netlify website
# https://docs.netlify.com/configure-builds/file-based-configuration/#build-settings
[build]
command = """\
git fetch --tags https://github.com/streamlink/streamlink.git \
&& pip install -U pip setuptools \
&& pip install -e . \
&& pip install -U -r docs-requirements.txt \
&& make --directory=docs clean html
"""
publish = "docs/_build/html"
# Since production builds can't be disabled without disabling PRs as well, pushes to the master branch need to be ignored.
# Also ignore pull requests which don't include any changes that would alter the docs:
# - CHANGELOG.md (symlinked from docs/changelog.md)
# - docs/
# - docs-requirements.txt
# - src/ (docstrings of documented APIs, plugin metadata, CLI arguments, etc.)
# https://docs.netlify.com/configure-builds/file-based-configuration/#ignore-builds
ignore = """\
[ $(git rev-parse --abbrev-ref HEAD) = master ] \
|| git diff --quiet master HEAD \
CHANGELOG.md \
docs/ \
docs-requirements.txt \
src/
"""
[build.environment]
# Set the latest natively available Python version in the Ubuntu env (currently 20.04 / Focal)
# https://docs.netlify.com/configure-builds/manage-dependencies/#python
# https://github.com/netlify/build-image/blob/xenial/included_software.md
PYTHON_VERSION = "3.8"
# Builds on untagged commits are always "latest", but since it's built on the root docs dir, actual "latest" links will cause 404 errors
# https://docs.netlify.com/configure-builds/file-based-configuration/#redirects
[[redirects]]
from = "/latest/*"
to = "/:splat"
status = 301