Skip to content

Commit c747f5d

Browse files
author
Tomi
committed
feat: add Cloudflare Worker to render README as GitHub Pages style
- worker/worker.js: fetches README.md from GitHub raw and renders with marked - wrangler.toml: Cloudflare Worker configuration - GitHub Actions workflow auto-deploys on README/worker changes - Uses Cloudflare Cache (5min TTL) for performance
1 parent 1d900fc commit c747f5d

6 files changed

Lines changed: 756 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Deploy to Cloudflare Workers
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- "README.md"
8+
- "worker/**"
9+
- "package.json"
10+
- "package-lock.json"
11+
- "wrangler.toml"
12+
workflow_dispatch:
13+
14+
jobs:
15+
deploy:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
24+
- run: npm ci
25+
26+
- run: npm run build
27+
28+
- uses: cloudflare/wrangler-action@v3
29+
with:
30+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
31+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
32+
command: deploy

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules/
2+
dist/
3+
.wrangler/

0 commit comments

Comments
 (0)