This guide covers setting up a Quartz repository on GitHub, configuring GitHub Pages for automatic deployment, and connecting Quartz Syncer.
Create a Quartz Repository
If you haven’t set up a Quartz repository on GitHub yet, click here to create one using the official Quartz template.
Configure GitHub Pages
Enable GitHub Pages
- Go to your repository on GitHub.
- Navigate to Settings > Pages.
- Under Source, select GitHub Actions.
Add the Deploy Workflow
Create a new file .github/workflows/deploy.yml in your repository with the following content:
name: Deploy Quartz site to GitHub Pages
on:
push:
branches:
- v4
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: npm ci
- name: Build Quartz
run: npx quartz build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: public
deploy:
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4Your site will be deployed to <username>.github.io/<repository-name>.
Generate an Access Token
Token Expiration
Fine-grained tokens expire after the specified date, with a maximum of one year. GitHub will email you when your token is about to expire.
Fine-grained Access Token (Recommended)
- Go to GitHub’s Personal Access Token page.
- Set a Token name (e.g.,
Quartz Syncer). - Set an Expiration date.
- Under Repository access, select Only select repositories and choose your Quartz repository.
- Under Permissions > Repository permissions, set Contents to Read and write.
- Click Generate token.
- Copy the token immediately.
Classic Access Token
Classic tokens have access to all your repositories. Use fine-grained tokens when possible.
- Go to GitHub’s Classic Token page.
- Add a Note and click Generate token.
- Copy the token immediately.
Configure Quartz Syncer
- Open Obsidian and go to Settings > Community Plugins > Quartz Syncer.
- In the Git settings tab:
- Remote URL:
https://github.com/<username>/<repository>.git - Branch:
v4(or your Quartz branch) - Provider: GitHub
- Authentication Type: Username & Token/Password
- Username: Your GitHub username
- Access Token: The token you generated
- Remote URL:
A green checkmark indicates a successful connection.
Custom Domain (Optional)
- In your repository, go to Settings > Pages.
- Under Custom domain, enter your domain and click Save.
- Configure your DNS:
- Apex domain (
example.com): CreateArecords pointing to:185.199.108.153185.199.109.153185.199.110.153185.199.111.153
- Subdomain (
docs.example.com): Create aCNAMErecord pointing to<username>.github.io.
- Apex domain (