Skip to content

Commit 9769503

Browse files
authored
DOC-3373: Add new .sh script to copy to root post build. (#3990)
* DOC-3373: Add new .sh script to copy to root post build. * DOC-3373: Simplify .sh approach.
1 parent bdf5aae commit 9769503

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

-scripts/copy-llms-files.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Copy llms.txt files to site root after Antora build
4+
# This makes them accessible at /docs/llms.txt and /docs/llms-full.txt for AI/LLM discoverability
5+
6+
set -e
7+
8+
BUILD_DIR="${1:-build/site}"
9+
10+
echo "Copying llms.txt files to $BUILD_DIR/..."
11+
12+
find "$BUILD_DIR" -mindepth 2 \( -name "llms.txt" -o -name "llms-full.txt" \) \
13+
-exec cp {} "$BUILD_DIR/" \; \
14+
-print
15+
16+
if [ ! -f "$BUILD_DIR/llms.txt" ] || [ ! -f "$BUILD_DIR/llms-full.txt" ]; then
17+
echo "Error: one or both llms.txt files were not copied to $BUILD_DIR"
18+
exit 1
19+
fi
20+
21+
echo "Done."

.github/workflows/deploy_docs_v2.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ jobs:
5050
- name: Build Website
5151
run: yarn antora ./antora-playbook.yml
5252

53+
- name: Copy llms.txt files to root
54+
run: ./-scripts/copy-llms-files.sh build/site
55+
5356
- name: Rename site folder to docs
5457
run: |
5558
mv ./build/site ./build/docs

.github/workflows/preview_create.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
- name: Build Website
4444
run: yarn antora ./antora-playbook.yml
4545

46+
- name: Copy llms.txt files to root
47+
run: ./-scripts/copy-llms-files.sh build/site
48+
4649
- name: Rename site folder to docs
4750
run: |
4851
mv ./build/site ./build/docs

0 commit comments

Comments
 (0)