Skip to content

Automating Obsidian Sync and Blog Deployment with Nextcloud and GitHub Actions

Published: at 11:44 PM

I recently set up a workflow that allows my Obsidian notes to automatically sync between devices and also update my blog without any manual intervention. This was accomplished using the Remotely Save plugin for Obsidian, a Nextcloud WebDAV connection, a GitHub Action that runs a Python script that syncs posts to the repository, and another action to deploy to GitHub Pages.

Table of contents

Open Table of contents

Inspiration

This setup was inspired by a video from NetworkChuck, where he explored how to create a blog post pipeline, from markdown written in Obsidian to a live blog post on your site. His approach made it easy to write and publish directly from Obsidian, but I wanted to take it a step further by adding automatic syncing across all my devices.

Instead of just pulling blog posts from Obsidian, I wanted my entire note-taking system to be synced seamlessly across devices. That way, any edits I made whether for blog posts or general notes would always be up to date no matter where I was working.

How It Works

1. Syncing Obsidian Notes with Nextcloud

To keep my Obsidian notes synced across devices, I used the Remotely Save plugin. This plugin allows Obsidian to sync files via various backends, including WebDAV, which I used to connect to my Nextcloud instance.

Originally, I wanted to sync my notes to GitHub. However, that proved to be a messy pain in the ass. So I decided to switch to my already existing Nextcloud instance.

Steps to Set Up Remotely Save with Nextcloud

  1. Install the Remotely Save plugin in Obsidian.
  2. Configure it to use WebDAV as the sync method.
  3. Enter the WebDAV URL of my Nextcloud instance.
  4. Provide authentication credentials.
  5. Enable automatic syncing so that any changes in my Obsidian vault are pushed to Nextcloud. With this setup, my notes are always up-to-date across devices without needing to rely on third-party cloud services like iCloud or Google Drive.

2. Automating Blog Updates with GitHub Actions

Since my blog posts are stored as Markdown files in my Obsidian vault, I wanted a way to automatically update my blog whenever I made changes to my notes. What I ended up going with was a GitHub Action that runs a Python script to:

  1. Fetch posts from my Nextcloud WebDAV folder (where my Obsidian notes are stored).
  2. Clone those posts into a GitHub repository.
  3. Push the updated posts to the repository.
  4. Trigger another workflow to deploy to GitHub Pages

These components should make up the Obsidian to blog pipeline! obsidian-to-blog-pipeline.png

See the specifics of this in my blog’s GitHub repo!

seansusmilch/seansusmilch.github.io I have a GitHub workflow called Sync Posts that does the following:

The Result

With this setup:

This workflow saves me time and ensures that my Obsidian notes are a “source of truth” so to speak.


Previous Post
Self-Hosting Everything: A Dive into My Proxmox-Powered Homelab
Next Post
Removing Closed Captions from M3U8 Streams w/ FFmpeg