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
- Install the Remotely Save plugin in Obsidian.
- Configure it to use WebDAV as the sync method.
- Enter the WebDAV URL of my Nextcloud instance.
- Provide authentication credentials.
- 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:
- Fetch posts from my Nextcloud WebDAV folder (where my Obsidian notes are stored).
- Clone those posts into a GitHub repository.
- Push the updated posts to the repository.
- Trigger another workflow to deploy to GitHub Pages
These components should make up the Obsidian to blog pipeline!
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:
- This sets up an
rclone
remote to my WebDAV endpoint - Then runs a Python script that will sync posts to the repo
- Then triggers the Deploy to GitHub Pages workflow
The Result
With this setup:
- My Obsidian notes stay synced across all my devices via Nextcloud WebDAV.
- My blog updates automatically whenever I edit posts in Obsidian.
- No manual intervention is needed to deploy new posts.
This workflow saves me time and ensures that my Obsidian notes are a “source of truth” so to speak.