-
Notifications
You must be signed in to change notification settings - Fork 2
97 lines (84 loc) · 3.07 KB
/
docs.yml
File metadata and controls
97 lines (84 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
name: Documentation
on:
push:
branches: [main]
pull_request:
paths:
- ".github/workflows/docs.yml"
- "Makefile"
- "devtools/ddp/src/ddp/plugin_docs.py"
- "devtools/ddp/src/ddp/package_index.py"
- "catalog/plugins.json"
- "docs/**"
- "plugins/**/docs/**"
- "pyproject.toml"
- "uv.lock"
- "zensical.toml"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/configure-pages@v5
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
- uses: astral-sh/setup-uv@v4
with:
python-version: "3.10"
enable-cache: true
- run: make sync
- name: Prepare package list
env:
GH_TOKEN: ${{ github.token }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: |
mkdir -p package-index-metadata
PACKAGE_LIST=package-index-metadata/packages.json
if { [ "${{ github.event_name }}" = "push" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; } \
&& [ "${{ github.ref }}" = "refs/heads/main" ]; then
ASSET_ID=$(gh api "repos/${GITHUB_REPOSITORY}/releases/tags/ddp-package-assets" \
--jq '.assets[] | select(.name == "packages.json") | .id' 2>/dev/null || true)
if [ -n "${ASSET_ID}" ]; then
gh api \
-H "Accept: application/octet-stream" \
"repos/${GITHUB_REPOSITORY}/releases/assets/${ASSET_ID}" > "${PACKAGE_LIST}"
echo "Downloaded package list from ddp-package-assets/packages.json"
else
: > "${PACKAGE_LIST}"
echo "No ddp-package-assets/packages.json asset found; building docs with an empty package list"
fi
else
: > "${PACKAGE_LIST}"
echo "Building docs with an empty package list for non-deploy event"
fi
wc -c "${PACKAGE_LIST}"
- run: make docs PACKAGE_LIST=package-index-metadata/packages.json
- uses: actions/upload-pages-artifact@v4
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
with:
path: site
- uses: actions/upload-artifact@v4
if: github.event_name == 'pull_request'
with:
name: docs-site
path: site
if-no-files-found: error
deploy:
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v4
id: deployment