Skip to main content

Private Blog Posts Using Git Submodules

Alternate titles:

  • separate your writing from your coding with git sub modules

To Read

Read

GitHub

  1. Create blog repo (public or private)
  2. Create posts repo (private)

Blog repo

  1. Add posts repo as a submodule — steps?
git submodule add git@github.com:ooloth/content.git src/content

Posts repo

  1. Create a personal access token
  2. Add private access token to repo secrets
  3. Create a GitHub Actions workflow to publish posts changes to blog repo automatically

Netlify

  1. On blog site, add generate a deploy key
  2. On posts repo, save deploy key in Settings > Deploy keys

Publishing

My current process for updating the site looks like:

  1. Make changes to posts repo a. On iOS, I use Working Copy and sometimes iA Writer for a nicer writing experience b. On macOS, I use VS Code (with Alfred/Raycast ingtegration?)
  2. Commit + push changes to posts repo
  3. A GitHub Action workflow in my posts repo automatically pushes the changes to the blog repo
  4. Netlify notices the changes to the blog repo and deploys a new version