-
Couldn't load subscription status.
- Fork 423
feat: add llms.txt workflow #2032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
jcstein
wants to merge
3
commits into
main
Choose a base branch
from
jcs/llms
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Generate LLMs.txt File | ||
| permissions: | ||
| contents: write | ||
|
|
||
| on: | ||
| # Run on a schedule using cron | ||
| schedule: | ||
| # Run daily at midnight UTC | ||
| - cron: '0 0 * * *' | ||
| # Keep manual triggering ability | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| generate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Generate llms.txt | ||
| run: npx -y llmstxt gen https://docs.celestia.org/sitemap.xml > public/llms.txt | ||
|
|
||
| - name: Commit and push if changed | ||
| run: | | ||
| git config --global user.name 'GitHub Actions' | ||
| git config --global user.email '[email protected]' | ||
| git add public/llms.txt | ||
| git diff --quiet && git diff --staged --quiet || (git commit -m "Update llms.txt file" && git push) | ||
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Show fixed
Hide fixed
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized this is using the site to build it, so wouldn't build it from the new content being changed/added. so maybe this should be a cron job 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ae4af0e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think post-merge would be even better:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think
/docsdoesn't exist. would the post-merge work still if the site hasn't built, since it's generating it from the built site?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hadn't noticed/focused on it. I think you are correct.
In this case, removing this "paths" key altogether should be fine, really, because the cmd is reading from the deployed website.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I don't know how deployment is working for now, but I am guessing it takes a moment for it to be live after merge, right?
So I got 2 decent solutions to ponder:

or
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's do sleep for 10 mins then build it, should only take 5 mins max to build but better to be on safe side