|
5 | 5 | - main |
6 | 6 |
|
7 | 7 | jobs: |
8 | | - generate-llms: |
9 | | - runs-on: ubuntu-latest |
10 | | - permissions: |
11 | | - contents: write |
12 | | - actions: read |
13 | | - outputs: |
14 | | - files-changed: ${{ steps.check-changes.outputs.changed }} |
15 | | - steps: |
16 | | - - name: 📥 Checkout |
17 | | - uses: actions/checkout@v4 |
18 | | - with: |
19 | | - token: ${{ secrets.PAT_AUTO_MERGE_LLMS_TXT_TOKEN }} |
20 | | - fetch-depth: 0 |
21 | | - |
22 | | - - name: 🟢 Setup Node.js |
23 | | - uses: actions/setup-node@v4 |
24 | | - with: |
25 | | - node-version: '20' |
26 | | - |
27 | | - - name: 📦 Install dependencies |
28 | | - working-directory: ./docusaurus |
29 | | - run: npm install |
30 | | - |
31 | | - - name: 🤖 Generate LLMs files |
32 | | - working-directory: ./docusaurus |
33 | | - run: npm run generate-llms |
34 | | - |
35 | | - - name: 🤖 Generate LLMs code file |
36 | | - working-directory: ./docusaurus |
37 | | - run: | |
38 | | - node scripts/llms/generate-llms-code.js --anchors --all --output static/llms-code.txt |
39 | | - node scripts/llms/validate-llms-code.js --path static/llms-code.txt --strict --verify-anchors --project-root .. |
40 | | - |
41 | | - - name: 🔍 Check for changes |
42 | | - id: check-changes |
43 | | - run: | |
44 | | - if git diff --quiet HEAD -- docusaurus/static/llms.txt docusaurus/static/llms-full.txt docusaurus/static/llms-code.txt; then |
45 | | - echo "changed=false" >> $GITHUB_OUTPUT |
46 | | - echo "🔄 No changes in LLMs files" |
47 | | - else |
48 | | - echo "changed=true" >> $GITHUB_OUTPUT |
49 | | - echo "📝 LLMs files have changes" |
50 | | - fi |
51 | | - |
52 | | - - name: 📤 Commit and push changes |
53 | | - if: steps.check-changes.outputs.changed == 'true' |
54 | | - run: | |
55 | | - git config --local user.email "noreply@github.com" |
56 | | - git config --local user.name "GitHub Actions" |
57 | | - git add docusaurus/static/llms.txt docusaurus/static/llms-full.txt docusaurus/static/llms-code.txt |
58 | | - git commit -m "🤖 Update LLMs files [skip ci]" |
59 | | - git push |
60 | | -
|
61 | 8 | deploy-prod: |
62 | 9 | runs-on: ubuntu-latest |
63 | | - needs: generate-llms |
64 | 10 | steps: |
65 | 11 | - name: Get Vercel deployment URL |
66 | 12 | id: get-url-prod |
|
0 commit comments