Home > Topics

πŸš€ CI-Driven Publishing

πŸ€– AI Summary

  • πŸ“ High-Level Summary: A proposed architecture shift that moves all content transformation from mobile (Enveloppe plugin) to CI, enabling faster mobile sync and simpler workflow. 🎯

  • πŸ”‘ Key Concepts: The goal is to replace heavy on-device processing with a lightweight git sync, then let CI do the transformation work. This should dramatically reduce the time spent waiting on the phone! βš‘πŸ“±


πŸ“œ Research: Current System Analysis

🏠 Current Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  
β”‚                         CURRENT SYSTEM                                   β”‚  
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  
β”‚                                                                          β”‚  
β”‚  πŸ“± MOBILE (Enveloppe Plugin)              ☁️  GITHUB CI (Quartz)       β”‚  
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚  
β”‚  β”‚ 1. Scan vault for files     β”‚          β”‚ 1. Checkout code          β”‚ β”‚  
β”‚  β”‚ 2. Parse frontmatter       β”‚          β”‚ 2. Build Quartz           β”‚ β”‚  
β”‚  β”‚ 3. Convert wikilinks β†’ md  β”‚          β”‚ 3. Generate HTML          β”‚ β”‚  
β”‚  β”‚ 4. Process embeddings       β”‚          β”‚ 4. Deploy to Pages        β”‚ β”‚  
β”‚  β”‚ 5. Handle dataview queries β”‚          β”‚                           β”‚ β”‚  
β”‚  β”‚ 6. Commit to GitHub        β”‚          β”‚                           β”‚ β”‚  
β”‚  β”‚                             β”‚          β”‚                           β”‚ β”‚  
β”‚  ⚑ SLOW - lots of CPU work    β”‚          β”‚ ⚑ FAST - already optimizedβ”‚ β”‚  
β”‚  πŸ”‹ Battery drain              β”‚          β”‚ πŸ”Œ Unlimited resources    β”‚ β”‚  
β”‚  πŸ“Ά Network heavy              β”‚          β”‚ πŸ“Ά Just fetches code      β”‚ β”‚  
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  
β”‚                                                                          β”‚  
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  

πŸ”§ What Enveloppe Currently Does (on mobile)

Based on Enveloppe documentation:

  • πŸ”— Link Conversion: [[wikilinks]] β†’ markdown links
  • πŸ“„ Frontmatter Processing: Parses and transforms metadata
  • πŸ–ΌοΈ Embed Processing: Handles ![[embed]] syntax
  • πŸ“Š Dataview Support: Processes dataviewjs, inline DQL
  • πŸ“ Folder Notes: Renames to index.md as needed
  • πŸ”€ Repo Management: Creates branches, PRs, auto-merges
  • 🧹 File Cleanup: Removes depublished/deleted files

😩 Pain Points

  • ⚑ Mobile is slow: All transformation happens on phone CPU
  • πŸ”‹ Battery drain: Intensive processing on mobile
  • πŸ› Link bugs: Has caused broken links (see 2025-06-07 - video path issue)
  • πŸ”§ Complex config: Enveloppe settings are extensive
  • πŸ“± Platform-specific: Obsidian-only solution

πŸ—οΈ Proposed Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  
β”‚                      PROPOSED SYSTEM                                     β”‚  
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€  
β”‚                                                                          β”‚  
β”‚  πŸ“± MOBILE (Simple Git Sync)              ☁️  GITHUB CI               β”‚  
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚  
β”‚  β”‚ 1. Write/edit note          β”‚          β”‚ 1. Checkout raw content   β”‚ β”‚  
β”‚  β”‚ 2. Save (Obsidian auto-save)β”‚          β”‚ 2. Run Enveloppe CLI      β”‚ β”‚  
β”‚  β”‚ 3. Commit & push raw .md   β”‚          β”‚    (or custom transformer)β”‚ β”‚  
β”‚  β”‚                             β”‚          β”‚ 3. Build Quartz           β”‚ β”‚  
β”‚  β”‚                             β”‚          β”‚ 4. Deploy to Pages        β”‚ β”‚  
β”‚  β”‚                             β”‚          β”‚                           β”‚ β”‚  
β”‚  ⚑ INSTANT - just git push    β”‚          β”‚ ⚑ FAST - optimized CI    β”‚ β”‚  
β”‚  πŸ”‹ Minimal battery            β”‚          β”‚ πŸ”Œ Unlimited resources    β”‚ β”‚  
β”‚  πŸ“Ά Small payload (.md only)   β”‚          β”‚ πŸ“Ά Downloads content     β”‚ β”‚  
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚  
β”‚                                                                          β”‚  
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  

✨ Key Changes

  • πŸ“± Mobile: Use simple git sync (Working Copy on iOS, or other git apps)
    • 🚫 No plugin needed for publishing
    • πŸ“ Just push raw Obsidian vault files
  • ☁️ CI: Add content transformation step before Quartz build
    • Option A: Run Enveloppe CLI in CI
    • Option B: Write custom Node.js transformer
    • Option C: Extend Quartz with link conversion plugin
  • πŸ”— Link Strategy:
    • Keep wikilinks in Obsidian ([[note]])
    • Convert to markdown links in CI ([note](./note.md))
    • This preserves Obsidian usability! 🧑

πŸ“Š Benefits

AspectCurrent (Enveloppe)Proposed (CI-Driven)
Mobile sync time30-60s+5-10s
Battery impactHighMinimal
Link conversionOn-deviceIn CI
Quartz buildPre-optimizedSame
Failure modeMobile crashCI failure (retryable)
Offline workLimitedFull git workflow
Platform couplingObsidian-onlyAny git-synced content

🎯 Implementation Options

Option A: Enveloppe CLI in CI

  • πŸ‘ Pros: Proven transformation logic
  • πŸ‘Ž Cons: May need Docker or Node setup in CI
  • πŸ‘ Pros: Full control, minimal deps
  • πŸ‘Ž Cons: Must maintain ourselves

Option C: Quartz Native + Custom Plugin

  • πŸ‘ Pros: Single build pipeline
  • πŸ‘Ž Cons: More Quartz-specific

Recommended: Start with Option A or B, preserve Quartz optimization work πŸš€


πŸ›‘οΈ Risk Mitigation

🟒 Phase 1: Parallel Run (Low Risk)

  1. Set up CI to process raw content
  2. Keep Enveloppe running on mobile
  3. Compare outputs before switching
  4. Deploy both versions temporarily

🟑 Phase 2: Shadow Mode

  1. CI processes content but doesn’t deploy
  2. Validate output matches Enveloppe
  3. Fix any discrepancies

πŸ”΄ Phase 3: Switch

  1. Disable Enveloppe on mobile
  2. Enable CI transformation
  3. Monitor for 1 week
  4. Rollback plan ready

πŸ”™ Rollback Plan

  • Re-enable Enveloppe on mobile
  • Revert CI changes
  • No data loss (content in git)! πŸ’Ύ

πŸ“ Spec for Implementation (For Opus 4.6)

πŸ“‹ Context

  • Repository: bagrounds/obsidian-github-publisher-sync
  • Current: Enveloppe plugin does content transformation on mobile
  • Goal: Move transformation to CI for faster mobile workflow

πŸ“ Requirements

  1. CI Pipeline Enhancement

    • Add a new job or step before Quartz build
    • Process raw markdown files from content/ directory
    • Convert wikilinks ([[note]]) to markdown links ([note](./note.md))
    • Handle internal links with folder paths correctly
  2. Link Conversion Logic

    // Pseudocode for link conversion  
    const convertWikilinks = (content) => {  
      // [[note]] β†’ [note](./note.md)  
      // [[folder/note]] β†’ [note](./folder/note.md)  
      // [[note|alias]] β†’ [alias](./note.md)  
    }  
  3. Frontmatter Handling

    • Pass through share: true files only
    • Ensure share: false files remain unpublished
  4. Compatibility

    • Must work with existing Quartz build
    • Preserve all existing Quartz optimizations (content-hash cache, etc.)
    • No regression in build time
  5. Testing

    • Create test cases for link conversion
    • Verify output matches Enveloppe’s current output
    • Test with real content from vault

🎁 Deliverables

  1. Modified .github/workflows/deploy.yml with transformation step
  2. New transformation script (either Enveloppe CLI wrapper or custom)
  3. Test file proving correctness
  4. Documentation of the change

⚠️ Constraints

  • Keep build time under 2 minutes
  • Don’t break existing functionality
  • Maintain backward compatibility with existing content

βœ… Success Criteria

  • Mobile sync time reduced by 50%+
  • Build output identical to current system
  • No regressions in published site

πŸ“ Reflections on Blogging & Publishing