Skip to content

Commit 04e14d8

Browse files
committed
feat(llms.txt): Add GitHub Actions workflow to generate llms.txt
1 parent b7a17b1 commit 04e14d8

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/llms-txt.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Generate llms.txt
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
jobs:
13+
generate-llms-txt:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Ruby
21+
uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: '3.1'
24+
bundler-cache: true
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: '3.11'
30+
31+
- name: Install Python dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install pyyaml
35+
36+
- name: Build Jekyll site
37+
env:
38+
JEKYLL_ENV: production
39+
run: |
40+
bundle exec jekyll build
41+
42+
- name: Generate llms.txt
43+
run: |
44+
python scripts/generate_llms_txt.py
45+
46+
- name: Check llms.txt was generated
47+
run: |
48+
if [ ! -f llms.txt ]; then
49+
echo "Error: llms.txt was not generated"
50+
exit 1
51+
fi
52+
echo "llms.txt successfully generated"
53+
echo "File size: $(wc -c < llms.txt) bytes"
54+
echo "Line count: $(wc -l < llms.txt) lines"
55+
56+
- name: Upload llms.txt as artifact
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: llms-txt
60+
path: llms.txt
61+
retention-days: 30
62+
63+
- name: Display first 50 lines of llms.txt
64+
run: |
65+
echo "=== First 50 lines of llms.txt ==="
66+
head -n 50 llms.txt

0 commit comments

Comments
 (0)