skills-index.yml
1 name: Build Skills Index 2 3 on: 4 schedule: 5 # Run twice daily: 6 AM and 6 PM UTC 6 - cron: '0 6,18 * * *' 7 workflow_dispatch: # Manual trigger 8 push: 9 branches: [main] 10 paths: 11 - 'scripts/build_skills_index.py' 12 - '.github/workflows/skills-index.yml' 13 14 permissions: 15 contents: read 16 17 jobs: 18 build-index: 19 # Only run on the upstream repository, not on forks 20 if: github.repository == 'NousResearch/hermes-agent' 21 runs-on: ubuntu-latest 22 steps: 23 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 24 25 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 26 with: 27 python-version: '3.11' 28 29 - name: Install dependencies 30 run: pip install httpx==0.28.1 pyyaml==6.0.2 31 32 - name: Build skills index 33 env: 34 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 35 run: python scripts/build_skills_index.py 36 37 - name: Upload index artifact 38 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 39 with: 40 name: skills-index 41 path: website/static/api/skills-index.json 42 retention-days: 7 43 44 deploy-with-index: 45 needs: build-index 46 runs-on: ubuntu-latest 47 permissions: 48 pages: write 49 id-token: write 50 environment: 51 name: github-pages 52 url: ${{ steps.deploy.outputs.page_url }} 53 # Only deploy on schedule or manual trigger (not on every push to the script) 54 if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' 55 steps: 56 - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 57 58 - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 59 with: 60 name: skills-index 61 path: website/static/api/ 62 63 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 64 with: 65 node-version: 20 66 cache: npm 67 cache-dependency-path: website/package-lock.json 68 69 - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 70 with: 71 python-version: '3.11' 72 73 - name: Install PyYAML for skill extraction 74 run: pip install pyyaml==6.0.2 75 76 - name: Extract skill metadata for dashboard 77 run: python3 website/scripts/extract-skills.py 78 79 - name: Install dependencies 80 run: npm ci 81 working-directory: website 82 83 - name: Build Docusaurus 84 run: npm run build 85 working-directory: website 86 87 - name: Stage deployment 88 run: | 89 mkdir -p _site/docs 90 cp -r landingpage/* _site/ 91 cp -r website/build/* _site/docs/ 92 echo "hermes-agent.nousresearch.com" > _site/CNAME 93 94 - name: Upload artifact 95 uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 96 with: 97 path: _site 98 99 - name: Deploy to GitHub Pages 100 id: deploy 101 uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4