Add GitHub Actions workflow for auto-updates

This commit is contained in:
Alexa Louise
2025-12-26 18:33:36 -06:00
parent 8e63a45a83
commit f1d6521b15

62
.github/workflows/update-metrics.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: Update Metrics
on:
schedule:
# Run every hour
- cron: '0 * * * *'
workflow_dispatch: # Allow manual trigger
push:
branches:
- main
paths:
- 'scripts/**'
jobs:
update-metrics:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install requests PyGithub pyyaml anthropic
- name: Update infrastructure metrics
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
RAILWAY_API_TOKEN: ${{ secrets.RAILWAY_API_TOKEN }}
run: |
python scripts/update_infrastructure.py
- name: Update repository metrics
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/update_repositories.py
- name: Update code metrics
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
python scripts/update_code_metrics.py
- name: Update resume data
run: |
python scripts/update_resume_data.py
- name: Commit and push changes
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "🤖 Auto-update metrics $(date -u +%Y-%m-%dT%H:%M:%SZ)" && git push)