Search IconIcon to open search

Search

Publishing Obsidian via Github Actions

written by: Moritz Vogel

Last updated Feb 21, 2023

# Background Story

A few months ago, I started my own “Second Brain” (for which I use Obsidian). I really liked that I can structure my learnings and summaries from my lectures in a way I feel most comfortable with. Just a few weeks after I started using Obsidian, I thought: “wouldn’t it be great if I could access my Vault remotely from any device?” So I looked at my options:

# 1. Using Obsidian Sync

I saw, that Obsidian is offering a subscription Service for syncing Obsidian vaults to all of your devices. But while that would be a fairly easy way to achieve my desired result, I would need Obsidian installed on every device I want to look at my knowledge base.

# 2. Using Obsidian publish

On the same page, I saw that Obsidian is offering a publishing service as well. But for me as a software engineer it seemed like wasted money because I was sure it could be achieved with resources that are either free or already available to me.

# 3. Using Quartz

Since I decided I didn’t want to spend any money on this, I started using git as version control for my knowledge base. This made Obsidian Sync obsolete because I could sync my files between all my machines without any problems. I did however have some difficulties with git on my phone, so I thought that I could use CI/CD to publish my Vault to a website, so I could view it from anywhere.

# Implementation Rules

Luckily I found a repo which achieved mostly what I want: Quartz (it is based on Hugo, which I wanted to check out anyway)

Before I started using Quartz, I made a few rules on how I want my vault deployed:

  1. Fully automated I do not want to have to compile any markdown files to HTML files. I just want to commit my changes from Obsidian and want the changes to be automatically deployed to the webpage
  2. Compatible with my current vault I do not want to rebuild my current vault to fit a specific format.

# Setup

So how is my current setup? I followed the setup instructions from Quartz, which are already pretty good, but I had a few Problems:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  ...
  jobs:
  deploy:
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: 0
          submodules: recursive
  ...

I did not solve these problems yet, but I found some interesting projects which partly address these Problems

I changed some of these problems by hand to test out the rest of the setup. So I pushed my manual changes, and voilà: I had a GitHub page ready to go. I added a custom domain and quickly personalized hugo and now my knowledge base is available to the public under https://knowledge.vogel.business.

This blog is made in the same way, just a different vault! (Read the story: How this blog was born)

# Future plans