Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/deploy_to_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:

- name: 🔧 Build & Test
run: |
# Convert human-readable Geojson file into computer-friendly one
bundle exec rake compact_geojson
# Jekyll plugin automatically runs upsert_dojos_geojson, compact_geojson, and cache_dojo_logos
JEKYLL_ENV=production bundle exec jekyll build
JEKYLL_ENV=production bundle exec jekyll doctor
SKIP_BUILD=true bundle exec rake test
Expand Down
20 changes: 7 additions & 13 deletions .github/workflows/scheduler_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,16 @@ jobs:
run: |
bundle exec rake get_data_from_japan

- name: ☯️ Cache dojo logos in Japan
- name: 🔧 Build data to render DojoMap
run: |
bundle exec rake cache_dojo_logos
# Jekyll plugin automatically runs cache_dojo_logos, upsert_dojos_geojson, and compact_geojson
JEKYLL_ENV=production bundle exec jekyll build

- name: 📍 Generate DojoMap from Earth/Japan data
- name: ✅ Test
run: |
bundle exec rake upsert_dojos_geojson
bundle exec rake compact_geojson
# _site is already built in previous step
JEKYLL_ENV=production bundle exec jekyll doctor
SKIP_BUILD=true bundle exec rake test

- name: 🆙 Commit latest data to update DojoMap (if any)
run: |
Expand Down Expand Up @@ -87,14 +89,6 @@ jobs:
env:
GITHUB_TOKEN:

- name: 🔧 Build & Test
run: |
# Convert human-readable Geojson file into computer-friendly one
bundle exec rake compact_geojson
JEKYLL_ENV=production bundle exec jekyll build
JEKYLL_ENV=production bundle exec jekyll doctor
SKIP_BUILD=true bundle exec rake test

# This is NOT for security reason but for others, especially who fork,
# to easier find out which API key they need to replace with their own.
# Check out the official tutorial for details: https://docs.geolonia.com/tutorial
Expand Down
18 changes: 18 additions & 0 deletions _plugins/build_hooks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Pre-build tasks that run before Jekyll builds the site
Jekyll::Hooks.register :site, :after_init do |site|
puts "🔄 Running pre-build tasks..."

# Update GeoJSON data
puts " → Updating dojos.geojson..."
system('bundle exec rake upsert_dojos_geojson')

# Compact GeoJSON for production
puts " → Creating dojos.min.geojson..."
system('bundle exec rake compact_geojson')

# Cache dojo logos
puts " → Caching dojo logos..."
system('bundle exec rake cache_dojo_logos')

puts "✅ Pre-build tasks completed"
end