/ .github / workflows / deploy-site.yml
deploy-site.yml
 1  name: Deploy Site
 2  
 3  on:
 4    release:
 5      types: [published]
 6    push:
 7      branches: [main]
 8      paths:
 9        - 'website/**'
10        - 'skills/**'
11        - 'optional-skills/**'
12        - '.github/workflows/deploy-site.yml'
13    workflow_dispatch:
14  
15  permissions:
16    pages: write
17    id-token: write
18  
19  concurrency:
20    group: pages
21    cancel-in-progress: false
22  
23  jobs:
24    deploy-vercel:
25      if: github.event_name == 'release'
26      runs-on: ubuntu-latest
27      steps:
28        - name: Trigger Vercel Deploy
29          run: curl -X POST "${{ secrets.VERCEL_DEPLOY_HOOK }}"
30  
31    deploy-docs:
32      if: github.repository == 'NousResearch/hermes-agent'
33      runs-on: ubuntu-latest
34      environment:
35        name: github-pages
36        url: ${{ steps.deploy.outputs.page_url }}
37      steps:
38        - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5  # v4
39  
40        - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020  # v4
41          with:
42            node-version: 20
43            cache: npm
44            cache-dependency-path: website/package-lock.json
45  
46        - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065  # v5
47          with:
48            python-version: '3.11'
49  
50        - name: Install PyYAML for skill extraction
51          run: pip install pyyaml==6.0.2 httpx==0.28.1
52  
53        - name: Extract skill metadata for dashboard
54          run: python3 website/scripts/extract-skills.py
55  
56        - name: Regenerate per-skill docs pages + catalogs
57          run: python3 website/scripts/generate-skill-docs.py
58  
59        - name: Build skills index (if not already present)
60          env:
61            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62          run: |
63            if [ ! -f website/static/api/skills-index.json ]; then
64              python3 scripts/build_skills_index.py || echo "Skills index build failed (non-fatal)"
65            fi
66  
67        - name: Install dependencies
68          run: npm ci
69          working-directory: website
70  
71        - name: Build Docusaurus
72          run: npm run build
73          working-directory: website
74  
75        - name: Stage deployment
76          run: |
77            mkdir -p _site/docs
78            cp -r website/build/* _site/docs/
79            # llms.txt / llms-full.txt are also published at the site root
80            # (https://hermes-agent.nousresearch.com/llms.txt) because some
81            # agents and IDE plugins probe the classic root-level path rather
82            # than /docs/llms.txt. Same file, two URLs, one source of truth.
83            if [ -f website/build/llms.txt ]; then
84              cp website/build/llms.txt _site/llms.txt
85            fi
86            if [ -f website/build/llms-full.txt ]; then
87              cp website/build/llms-full.txt _site/llms-full.txt
88            fi
89  
90        - name: Upload artifact
91          uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa  # v3
92          with:
93            path: _site
94  
95        - name: Deploy to GitHub Pages
96          id: deploy
97          uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e  # v4