Skip to content

Commit ac5572e

Browse files
committed
feat: add AI-generated teaser system with revision tracking
Add infrastructure for automatically generating Open Graph teasers using the Anthropic API, with content-hash-based revision tracking to avoid unnecessary regeneration. Teasers are word-wrapped at 90 characters to respect the project's 92-char line width in YAML frontmatter. The CD workflow calls update-revisions and generate-teasers as separate steps and commits any changes.
1 parent 13e1d80 commit ac5572e

12 files changed

Lines changed: 1281 additions & 1 deletion

.github/workflows/cd.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
build:
3939
runs-on: ubuntu-latest
4040
name: build website
41+
permissions:
42+
contents: write
4143
steps:
4244
- uses: actions/checkout@v5
4345
- uses: actions/setup-node@v6
@@ -48,6 +50,10 @@ jobs:
4850
- run: npm ci
4951
env:
5052
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
53+
- run: npm run update-revisions
54+
- run: npm run generate-teasers
55+
env:
56+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
5157
- run: npm run build
5258
env:
5359
MAPBOX_PUBLIC_TOKEN: ${{ secrets.MAPBOX_PUBLIC_TOKEN }}
@@ -56,6 +62,13 @@ jobs:
5662
name: dist-www
5763
path: dist/www
5864
retention-days: 15
65+
- name: Commit auto-generated teasers
66+
run: |
67+
git config user.name "github-actions[bot]"
68+
git config user.email "github-actions[bot]@users.noreply.github.com"
69+
git add "www/**/*.md" .revisions.json
70+
git diff --cached --quiet || \
71+
git commit -m "chore: auto-generate teasers [skip ci]" && git push
5972
6073
deploy:
6174
needs:

0 commit comments

Comments
 (0)