Skip to content

Nixtla Simplified Documentation (Preview) #1849

Nixtla Simplified Documentation (Preview)

Nixtla Simplified Documentation (Preview) #1849

Workflow file for this run

name: Nixtla Simplified Documentation (Preview)
on:
push:
branches: main
workflow_dispatch:
jobs:
build-preview-documentation:
permissions:
contents: write
runs-on: ubuntu-latest
name: Clone all built documentation
steps:
- name: Clone docs repository
uses: actions/checkout@v4
with:
repository: Nixtla/docs
path: docs
ref: docs-preview
- name: Clone statsforecast
uses: actions/checkout@v4
with:
repository: Nixtla/statsforecast
path: statsforecast
ref: docs-preview
- name: Clone mlforecast
uses: actions/checkout@v4
with:
repository: Nixtla/mlforecast
path: mlforecast
ref: docs-preview
- name: Clone neuralforecast
uses: actions/checkout@v4
with:
repository: Nixtla/neuralforecast
path: neuralforecast
ref: docs-preview
- name: Clone hierarchicalforecast
uses: actions/checkout@v4
with:
repository: Nixtla/hierarchicalforecast
path: hierarchicalforecast
ref: docs-preview
- name: Clone utilsforecast
uses: actions/checkout@v4
with:
repository: Nixtla/utilsforecast
path: utilsforecast
ref: docs-preview
- name: Clone datasetsforecast
uses: actions/checkout@v4
with:
repository: Nixtla/datasetsforecast
path: datasetsforecast
ref: docs-preview
- name: Clone coreforecast
uses: actions/checkout@v4
with:
repository: Nixtla/coreforecast
path: coreforecast
ref: docs-preview
- name: Clone synforecast
uses: actions/checkout@v4
with:
repository: Nixtla/synforecast
path: synforecast
ref: docs-preview
- name: Copy documentation and merge configs
run: |
# Mirror each library's built docs into docs/<repo> (keep this list in
# sync with the checkout steps above).
# - `--delete` removes pages that were deleted or renamed upstream, which a
# plain `cp -R` would leave behind as stale, orphaned pages.
# - `--exclude .git` keeps each checkout's own repo metadata out of docs/,
# so git never sees docs/<repo> as an embedded repository.
# - `--checksum` compares content rather than size+mtime, so a same-second
# checkout can never leave a changed page un-synced.
# - `--info=DEL` logs every deleted path as an audit trail.
# The trailing slashes are load-bearing: "$repo/" syncs the directory's
# contents into "docs/$repo/" instead of nesting docs/<repo>/<repo>/.
# Refuse to mirror a checkout without docs.json: with `--delete` an empty
# or half-built upstream branch would otherwise silently wipe the library's
# pages (merge_docs.py skips a missing docs.json) and force-push the result.
for repo in statsforecast mlforecast neuralforecast hierarchicalforecast \
utilsforecast datasetsforecast coreforecast synforecast; do
test -f "$repo/docs.json" \
|| { echo "::error::$repo checkout has no docs.json; refusing to mirror with --delete"; exit 1; }
rsync -a --checksum --delete --info=DEL --exclude .git "$repo/" "docs/$repo/"
done
cd docs && python3 merge_docs.py
- name: Commit and push changes
run: |
cd docs
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git checkout docs-preview
git add .
git diff-index --quiet --cached HEAD -- || git commit -m "Update documentation"
git push origin docs-preview --force