Publish Bot Metrics #8168
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
| name: Publish Bot Metrics | |
| on: | |
| # Run on schedule (every 10 minutes) | |
| schedule: | |
| - cron: '*/10 * * * *' | |
| # Run on manual trigger | |
| workflow_dispatch: | |
| # Run when metrics are updated manually | |
| push: | |
| paths: | |
| - 'metrics/metrics.json' | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Export metrics | |
| run: bun run scripts/export-metrics.ts | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./metrics | |
| destination_dir: metrics | |
| keep_files: true | |
| commit_message: 'chore: update bot metrics' | |
| - name: Summary | |
| run: | | |
| echo "### 📊 Metrics Published" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Metrics have been published to GitHub Pages:" >> $GITHUB_STEP_SUMMARY | |
| echo "https://brendadeeznuts1111.github.io/Arsenal-Lab/metrics/metrics.json" >> $GITHUB_STEP_SUMMARY |