Digital garden setup

Everything to know on how this site was set up.

Source

Repositories:

Tokens

  • obsidian-vault has a token that allows a dispatch action to be sent to mahulst.dev (metadata:read and contents:read&write permissions needed)
  • mahulst.dev has a token that allows to read the contents of obsidian-vault (contennts:read permissions needed)

Cloudflare pages

Hosted using a Cloudflare Pages static site

Github actions

mahulst.dev controls the deploy to cloudflare pages. High level overview:

  • checkout quartz site
  • checkout obsidian vault into the configured place
  • run npm install and friends
  • run deploy-to-cloudflare-pages action

To allow changes to the vault also triggering a new build, dispatch a custom event like this:

curl --fail \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Authorization: token ${{ secrets.DISPATCH_TOKEN }}" \
--request POST \
--data '{"event_type": "build_page", "client_payload": { "source": "vault" }}' https://api.github.com/repos/mahulst/mahulst.dev/dispatches

in the mahulst.dev repo listen to this event:

on:
  push:
    branches: [main]
  repository_dispatch:
    types: [build_page]
# ... rest of build steps