Browse Source

ci: add netlify docs preview deploy config

pull/3463/head
bastimeyer 11 months ago
committed by Forrest
parent
commit
1cda6ef109
  1. 2
      .editorconfig
  2. 27
      netlify.toml

2
.editorconfig

@ -9,7 +9,7 @@ insert_final_newline = true
max_line_length = 128
trim_trailing_whitespace = true
[*.{cfg,svg,yml}]
[*.{cfg,svg,toml,yml}]
indent_size = 2
[*.{md,markdown}]

27
netlify.toml

@ -0,0 +1,27 @@
# 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 = "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:
# - docs/
# - docs-requirements.txt
# - src/streamlink_cli/argparser.py
# https://docs.netlify.com/configure-builds/file-based-configuration/#ignore-builds
ignore = "[ $(git rev-parse --abbrev-ref HEAD) = master ] || git diff --quiet master HEAD docs/ docs-requirements.txt src/streamlink_cli/argparser.py"
[build.environment]
# Set the latest natively available Python version in the Ubuntu env (currently 16.04 / Xenial)
# https://docs.netlify.com/configure-builds/manage-dependencies/#python
# https://github.com/netlify/build-image/blob/xenial/included_software.md
PYTHON_VERSION = "3.7"
# 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
Loading…
Cancel
Save