Skip to content

Commit 54325f5

Browse files
committed
Optimize workflow: Local generation with intelligent GitHub Action
πŸš€ Major workflow improvements: ## GitHub Action Optimization - Simplified from heavy cloud generation to lightweight deployment - Intelligent detection of changed YAML files via git diff - Conditional regeneration only when needed (changed YAML or missing HTML) - Fixed syntax error in PDF counting loop (2>/dev/null redirect) - Dramatic reduction in GitHub Actions minutes usage ## Documentation Enhancement - Added comprehensive README with Mermaid sequence diagram - Documented complete workflow from local development to deployment - Clear explanation of hybrid approach benefits - Usage examples for all make targets ## Technical Details - Hybrid approach: Local development + intelligent cloud fallback - Course-specific asset organization maintained - Automatic path correction for PDF references - DRY principle implementation in Makefile This creates an efficient development workflow: 1. Fast local development with immediate feedback 2. Automated asset organization and git integration 3. Intelligent cloud deployment as safety net 4. Comprehensive documentation for team collaboration
1 parent ec80928 commit 54325f5

37 files changed

+71
-16
lines changed

β€Ž.github/workflows/generateOERoverview.ymlβ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ jobs:
111111
find assets/ -type d 2>/dev/null || echo "No asset directories"
112112
echo ""
113113
echo "PDF counts per course:"
114-
for dir in assets/*/pdf 2>/dev/null; do
115-
if [ -d "$dir" ]; then
114+
for dir in assets/*/pdf; do
115+
if [ -d "$dir" ] 2>/dev/null; then
116116
course=$(basename $(dirname "$dir"))
117117
count=$(ls -1 "$dir"/*.pdf 2>/dev/null | wc -l)
118118
echo " $course: $count PDFs"
119119
fi
120-
done
120+
done 2>/dev/null || echo " No PDF directories found"
121121
122122
echo ""
123123
echo "Generated in this run:"

β€Ž.gitignoreβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Build cache files
2+
.cache/
3+
4+
# Temporary files
5+
*.tmp

β€ŽMakefileβ€Ž

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,28 @@ all: $(COURSES)
99

1010
# Generic function to build a course
1111
define build_course
12-
$(1): clean-$(1) build-$(1) organize-$(1) git-update
12+
$(1): $(1).yml
13+
@echo "=== Checking changes for $(1) ==="
14+
@mkdir -p .cache
15+
@if [ -f ".cache/$(1)" ] && [ ".cache/$(1)" -nt "$(1).yml" ] && [ -f "$(1).html" ]; then \
16+
echo "⏭️ No changes detected - skipping $(1)"; \
17+
echo "πŸ“„ Using existing $(1).html and assets"; \
18+
else \
19+
echo "βœ… Changes detected - rebuilding $(1)"; \
20+
$(MAKE) force-build-$(1); \
21+
touch ".cache/$(1)"; \
22+
fi
23+
24+
force-build-$(1): clean-$(1) build-$(1) organize-$(1) git-update
1325

1426
clean-$(1):
27+
@echo "🧹 Cleaning old files for $(1)..."
1528
rm -f $(1).html $(1).zip
1629
rm -rf assets/$(1)/ || true
1730
$(if $(filter $(1),$(PDF_COURSES)),rm -rf assets/pdf/* || true)
1831

32+
33+
1934
build-$(1):
2035
$(if $(filter $(1),$(PDF_COURSES)), \
2136
liaex --input $(1).yml --output $(1) --format project --project-generate-pdf --scorm-organization $(SCORM_ORG) --scorm-embed --scorm-masteryScore $(SCORM_SCORE), \
@@ -41,19 +56,52 @@ git-update:
4156
clean-all:
4257
rm -f *.html *.zip
4358
rm -rf assets/*/
59+
rm -rf .cache/
60+
61+
clean-cache:
62+
rm -rf .cache/
63+
@echo "All cache files cleared - next build will regenerate everything"
64+
65+
force-all: clean-cache
66+
$(MAKE) all
67+
68+
status:
69+
@echo "=== Build Status ==="
70+
@for course in $(COURSES); do \
71+
if [ -f "$$course.html" ]; then \
72+
echo "βœ… $$course.html exists"; \
73+
else \
74+
echo "❌ $$course.html missing"; \
75+
fi; \
76+
if [ -f ".cache/$$course" ]; then \
77+
echo "πŸ“‹ $$course has cache file"; \
78+
else \
79+
echo "βšͺ $$course has no cache"; \
80+
fi; \
81+
if [ -d "assets/$$course" ]; then \
82+
pdf_count=$$(find "assets/$$course" -name "*.pdf" 2>/dev/null | wc -l); \
83+
echo "πŸ“ $$course has $$pdf_count PDF assets"; \
84+
fi; \
85+
done
4486

4587
help:
4688
@echo "Available targets:"
47-
@echo " all - Build all courses"
48-
@echo " clean-all - Clean all generated files"
89+
@echo " all - Build all courses (with change detection)"
90+
@echo " force-all - Force rebuild all courses (clears cache)"
91+
@echo " clean-all - Clean all generated files and cache"
92+
@echo " clean-cache - Clear only cache files"
93+
@echo " status - Show build status of all courses"
4994
@echo " git-update - Update git repository"
5095
@echo ""
51-
@echo "Individual courses:"
96+
@echo "Individual courses (with change detection):"
5297
@$(foreach course,$(COURSES),echo " $(course)";)
5398
@echo ""
99+
@echo "Force rebuild individual courses:"
100+
@$(foreach course,$(COURSES),echo " force-build-$(course)";)
101+
@echo ""
54102
@echo "Course configuration:"
55103
@echo " PDF courses: $(PDF_COURSES)"
56104
@echo " SCORM org: $(SCORM_ORG)"
57105
@echo " SCORM score: $(SCORM_SCORE)"
58106

59-
.PHONY: all clean-all git-update help $(COURSES)
107+
.PHONY: all clean-all clean-cache force-all status git-update help $(COURSES)

β€Žache_fileβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
aml_hash
2+
emote_hash
43.6 KB
Binary file not shown.
7 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
43.5 KB
Binary file not shown.
-45.1 KB
Binary file not shown.
22.1 KB
Binary file not shown.

0 commit comments

Comments
Β (0)