Skip to content

Generate llms.txt

Generate llms.txt #1

name: Generate llms.txt
on:
# Weekly schedule: Monday at 06:00 UTC
schedule:
- cron: '0 6 * * 1'
# Manual trigger via GitHub UI
workflow_dispatch:
permissions:
contents: write
jobs:
generate:
name: Generate llms.txt files
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Enable Corepack
run: corepack enable
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'yarn'
- name: Build site and generate llms.txt
run: make generate-llms
env:
GENERATE_LLMS: 'true'
NODE_OPTIONS: '--max-old-space-size=4096'
DOCUSAURUS_IGNORE_SSG_WARNINGS: 'true'
- name: Check for changes
id: diff
run: |
if git diff --quiet static/llms.txt static/calico static/calico-enterprise static/calico-cloud 2>/dev/null; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add static/llms.txt \
static/calico/llms.txt static/calico/llms-full.txt \
static/calico-enterprise/llms.txt static/calico-enterprise/llms-full.txt \
static/calico-cloud/llms.txt static/calico-cloud/llms-full.txt
git commit -m "chore: update generated llms.txt files"
git push