Skip to content

Commit 3f7cc5a

Browse files
committed
Jekyllビルド時のデータ更新を自動化し、GitHub Actionsを最適化
1. Jekyllビルドフック追加(_plugins/build_hooks.rb) - jekyll buildまたはjekyll server実行時に自動的に以下を実行: - upsert_dojos_geojson: GeoJSON生成 - compact_geojson: GeoJSON圧縮(22.9%削減) - cache_dojo_logos: ロゴキャッシュ - ローカル開発でも本番環境でも一貫した動作 2. GitHub Actions最適化(scheduler_daily.yml) - 二重実行していたcompact_geojsonを削除 - Jekyllプラグインが自動実行するため不要に - ビルド時間の短縮とコードの簡潔化
1 parent bff1711 commit 3f7cc5a

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/scheduler_daily.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ jobs:
8989

9090
- name: 🔧 Build & Test
9191
run: |
92-
# Convert human-readable Geojson file into computer-friendly one
93-
bundle exec rake compact_geojson
92+
# Jekyll plugin automatically runs upsert_dojos_geojson, compact_geojson, and cache_dojo_logos
9493
JEKYLL_ENV=production bundle exec jekyll build
9594
JEKYLL_ENV=production bundle exec jekyll doctor
9695
SKIP_BUILD=true bundle exec rake test

_plugins/build_hooks.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Pre-build tasks that run before Jekyll builds the site
2+
Jekyll::Hooks.register :site, :after_init do |site|
3+
puts "🔄 Running pre-build tasks..."
4+
5+
# Update GeoJSON data
6+
puts " → Updating dojos.geojson..."
7+
system('bundle exec rake upsert_dojos_geojson')
8+
9+
# Compact GeoJSON for production
10+
puts " → Creating dojos.min.geojson..."
11+
system('bundle exec rake compact_geojson')
12+
13+
# Cache dojo logos
14+
puts " → Caching dojo logos..."
15+
system('bundle exec rake cache_dojo_logos')
16+
17+
puts "✅ Pre-build tasks completed"
18+
end

0 commit comments

Comments
 (0)