๐ฌ Sync GitHub Markdown docs with StudioCMS pages and taxonomy
โก 0 views ยท ๐ฌ Document Extraction & Analysis
๐ก Pro Tip โ If you need GitHub data beyond what the REST API gives you, ScraperNode has a repository scraper that extracts metadata at scale without token rate limits.
Description
Quick overview
This workflow manually syncs a GitHub directory of Markdown/MDX files to StudioCMS by parsing frontmatter, creating missing folders/categories/tags, and then creating, updating, skipping, or drafting pages based on slug comparisons.
How it works
- Starts when you manually trigger a deployment.
- Lists files from the configured GitHub repository directory and continues only if Markdown/MDX files are found.
- Downloads each Markdown/MDX file from GitHub, decodes it, and parses YAML-style frontmatter to derive page fields like title, slug, folder, categories, tags, and draft status.
- Validates the collection (including duplicate slug detection) and loads the current StudioCMS folders, categories, tags, and pages.
- Creates any missing StudioCMS folders, categories, and tags needed by the valid Markdown documents, then refreshes the StudioCMS taxonomy lists.
- Compares each document to existing StudioCMS pages by slug to plan and apply creates/updates/skips, and optionally marks missing managed pages as drafts when configured.
- Produces a deployment report summarizing created, updated, drafted, skipped, and errored items.
Setup
- Add GitHub API credentials and select them in the GitHub nodes that list and fetch repository files.
- Add StudioCMS API credentials and select them in all StudioCMS nodes that read and write folders, categories, tags, and pages.
- In the GitHub source configuration, set the repository owner, repository name, and source directory path containing your flat Markdown/MDX collection.
- Ensure each Markdown/MDX file has unique slugs (via frontmatter
slugor its filename) and optional frontmatter fields you want synced (for examplefolder,categories,tags,draft, andshowOnNav). - If you enable orphan drafting, set
draftMissingPagesto true and provide a non-emptymanagedSlugPrefixso only pages with that prefix are considered for drafting.
๐ Nodes Used
GitHub
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File