Skip to content

Commit 804dc9b

Browse files
spicyfalafelclaude
andcommitted
Add docs-tools: lint, image optimization, OG generation
- package.json with docs-lint, docs-images, docs-og scripts - GitHub Actions workflow for CI lint + image optimization - Pre-push hook via postinstall - .gitignore: node_modules, .docs-tools Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 747daa3 commit 804dc9b

4 files changed

Lines changed: 188 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
19+
- run: bun install
20+
- run: bun lint
21+
22+
images:
23+
runs-on: ubuntu-latest
24+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: oven-sh/setup-bun@v2
29+
with:
30+
bun-version: latest
31+
32+
- run: bun install
33+
- run: bun images:optimize
34+
- run: bun og:generate
35+
36+
- name: Commit optimized assets
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "github-actions[bot]@users.noreply.github.com"
40+
git add assets/ docs/
41+
git diff --cached --quiet || git commit -m "chore: optimize images + generate OG previews"
42+
git push

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
*~
44
.idea/
55
.vscode/
6+
7+
# docs-tools
8+
node_modules/
9+
.docs-tools/

bun.lock

Lines changed: 123 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "formbox-docs",
3+
"private": true,
4+
"scripts": {
5+
"postinstall": "install-hooks",
6+
"lint": "docs-lint",
7+
"lint:check": "docs-lint --check",
8+
"lint:json": "docs-lint --json",
9+
"images:check": "docs-images check",
10+
"images:optimize": "docs-images optimize",
11+
"images:dry-run": "docs-images optimize --dry-run",
12+
"og:generate": "docs-og generate",
13+
"og:dry-run": "docs-og generate --dry-run",
14+
"og:diff": "docs-og generate --diff"
15+
},
16+
"devDependencies": {
17+
"docs-tools": "github:HealthSamurai/docs-tools"
18+
}
19+
}

0 commit comments

Comments
 (0)