mirror of
https://github.com/nubenetes/awesome-kubernetes.git
synced 2026-07-13 18:30:44 +00:00
Each (category × period) cell in news_digest.json now carries a hash of its entry pool (sorted URLs). Before calling Gemini, the engine checks: 1. Hash matches stored hash (same inventory entries) 2. Last analyzed within MAX_STALENESS_DAYS=30 Both conditions true → reuse existing ranked list, 0 Gemini API calls. Only cells where the inventory actually changed (new/removed entries) trigger a fresh Gemini ranking. Expected savings: re-runs with code-only changes → 0 API calls (down from 66). New ingestion batch → only affected categories call Gemini (5-10 of 26 typical). Stale refresh (>30d) → full refresh at most once per month. Also: - Remove day-level GitHub Actions cache for digest (redundant: news_digest.json is committed to the repo and is the persistent store for _meta) - Always run news_digest.py in both 04.1 and 09 workflows (it's cheap when 0 Gemini calls are needed) - Trending badge now reads _meta.last_updated (actual analysis date) instead of file mtime (which changes on every render/commit) - Remove invalid extra_head key from v2-mkdocs.yml (left over from rollback) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
79 lines
2.4 KiB
YAML
79 lines
2.4 KiB
YAML
name: 09. Weekly Intelligence Digest
|
|
|
|
on:
|
|
schedule:
|
|
# Every Monday at 06:00 UTC (08:00 Madrid time)
|
|
- cron: '0 6 * * 1'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: develop-git-write-lock
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
weekly-digest:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Repository Synchronization
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: develop
|
|
fetch-depth: 0
|
|
|
|
- name: Python 3.11 Environment Provisioning
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.11'
|
|
cache: 'pip'
|
|
|
|
- name: Install Dependencies
|
|
run: pip install -r requirements.txt
|
|
|
|
- name: Generate News Digest (Incremental)
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
GEMINI_API_KEY_1: ${{ secrets.GEMINI_API_KEY_1 }}
|
|
GEMINI_API_KEY_2: ${{ secrets.GEMINI_API_KEY_2 }}
|
|
run: |
|
|
# Incremental engine: reuses stored results for unchanged categories.
|
|
# On Monday, only categories with new entries since the last run
|
|
# (or older than MAX_STALENESS_DAYS=30) trigger Gemini API calls.
|
|
python -u -m src.news_digest
|
|
|
|
- name: Generate RSS Feed
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
run: |
|
|
python -u -m src.rss_generator || echo "RSS generation skipped"
|
|
|
|
- name: Render V2 Portal (Digest Pages Only)
|
|
env:
|
|
PYTHONPATH: ${{ github.workspace }}
|
|
PYTHONUNBUFFERED: "1"
|
|
run: |
|
|
python -u -m src.v2_optimizer --render-only
|
|
|
|
- name: Commit and Push Weekly Digest
|
|
run: |
|
|
git config --global user.name "Nubenetes Bot"
|
|
git config --global user.email "bot@nubenetes.com"
|
|
git add data/news_digest.json v2-docs/tech-digest.md v2-docs/industry-digest.md v2-docs/feed.xml || true
|
|
if git diff --staged --quiet; then
|
|
echo "No digest changes to commit."
|
|
else
|
|
git commit -m "feat: weekly intelligence digest update [skip ci]"
|
|
for i in {1..3}; do
|
|
git pull origin develop --rebase && git push origin develop && break || sleep 10
|
|
done
|
|
fi
|
|
|
|
- name: Trigger V2 Publisher
|
|
uses: peter-evans/repository-dispatch@v3
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
event-type: weekly-digest-ready
|