The Quartz GitHub Action builds a Quartz site from a repository that holds only your notes. You don’t clone or fork Quartz: on every push, the action checks out a Quartz release, installs your plugins, builds the site and hands it to GitHub Pages.
- Just notes (an Obsidian vault, a
docs/folder in a project, a notes repository): use the action. Your repository stays small, and new Quartz releases reach your site withoutnpx quartz upgrade. - Changes to Quartz itself (your own components, layouts or edits to Quartz’s code): keep your own copy of Quartz, set up as in installation, and deploy it as in hosting.
Both build the same site from the same quartz.config.yaml. The action needs Quartz 5.4.0 or later.
Set it up
Your repository needs only your notes:
content/ your notes (or docs/)
quartz.config.yaml your configuration (optional)
quartz.lock.json your pinned plugins (optional)
-
Create
.github/workflows/deploy.yml:.github/workflows/deploy.yml name: Deploy Quartz site to GitHub Pages on: push: branches: [main] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: false jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 with: fetch-depth: 0 # the full history, for created and modified dates - uses: quartz-community/action@v1 deploy: needs: build environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - id: deployment uses: actions/deploy-pages@v5Change
mainif your notes live on another branch. -
In your repository’s Settings, under Pages, set Source to GitHub Actions.
-
Push. The site is published at
<github-username>.github.io/<repository-name>.
With only content/, the site uses Quartz’s default configuration, titled with your repository’s name, at its GitHub Pages address.
Where your notes are
The action reads your notes from content/, or from docs/ when there is no content/. For notes elsewhere, set directory, such as . for an Obsidian vault at the repository root:
- uses: quartz-community/action@v1
with:
directory: .By default Quartz skips the .obsidian, private and templates folders, and files your .gitignore ignores. See private pages for keeping other notes off the site.
Configuration
Set your configuration in the workflow, in a quartz.config.yaml file, or both. Both take the same YAML as described in configuration.
In quartz.config.yaml
Start from Quartz’s defaults with extends: default and write down only what you change:
extends: default
configuration:
pageTitle: My notes
baseUrl: me.github.io/notes
plugins:
- source: "@quartz-community/graph"
enabled: false # turn off a default plugin
- source: github:me/my-plugin # add one
enabled: trueA full config without extends works too, but then changes to Quartz’s defaults in later releases don’t reach your site. Put the file elsewhere with the config input (for example config: docs/quartz.config.yaml).
In the workflow
configuration takes the same YAML, applied on top of your quartz.config.yaml, or on top of Quartz’s defaults when there is none:
- uses: quartz-community/action@v1
with:
configuration: |
configuration:
pageTitle: My notes
plugins:
- source: "@quartz-community/graph"
enabled: falseThis way a repository needs no Quartz files at all. With a config file, it’s handy to change one setting for one workflow, such as the baseUrl of a preview build.
The site’s address
Without a config file, baseUrl is your repository’s GitHub Pages address (owner.github.io/repository). For a custom domain, set base-url (or baseUrl in your configuration), and add the domain in your repository’s Pages settings as described in Custom Domain:
- uses: quartz-community/action@v1
with:
base-url: notes.example.comPlugins and quartz.lock.json
The default plugins ship with Quartz. Other plugins, from GitHub or npm, are installed on every build. quartz.lock.json is optional: it pins each of them to an exact commit or version, so every build uses the same plugins. Without it, the action installs each one at its latest release.
To create or update the lockfile, run the plugin commands with --config pointing at your site, from any Quartz 5.4.0 or later checkout:
npx quartz plugin install --config ../my-notes/quartz.config.yaml # pin what the config lists
npx quartz plugin install --config ../my-notes/quartz.config.yaml --latest # update the pinsThe lockfile is written next to quartz.config.yaml. Commit it.
Favicon, images and custom styles
The action copies these from your repository over Quartz’s own before building, if they exist:
quartz/static/: the favicon (icon.png), the default social image (og-image.png) and other files served fromstatic/quartz/styles/custom.scss: your custom styles, such as overrides for an Obsidian theme's colours
Choosing a Quartz version
The action builds with the newest Quartz 5 release by default, so fixes and new features reach your site on its next build. For a site that doesn’t change when Quartz releases a new version, pin one:
- uses: quartz-community/action@v1
with:
quartz-version: 5.4.1quartz-version also takes a tag, branch or commit of jackyzha0/quartz. Read upgrading before raising a pinned version.
Inputs
| Input | Default | Description |
|---|---|---|
quartz-version | latest | Quartz release to build with: latest (the newest 5.x release), a version, or a tag, branch or commit |
directory | content, else docs | Content folder, relative to the repository root (. for the root itself) |
config | quartz.config.yaml | Config file, relative to the repository root (optional). quartz.lock.json is read from the same folder |
configuration | Configuration as YAML: on top of the config file, or instead of one (then it extends default unless it says so) | |
base-url | The site’s address, such as notes.example.com. Without a config file, the repository’s GitHub Pages address | |
output | outside the repository | Folder the site is built into, relative to the repository root. Keep it outside the content folder |
node-version | 24 | Node.js version (Quartz needs 22.22 or later) |
cache | true | Cache npm downloads and installed plugins between runs |
upload-pages-artifact | true | Upload the site as a GitHub Pages artifact for actions/deploy-pages. Set to false to deploy it some other way |
The action’s outputs are quartz-version (the version the site was built with) and output (the absolute path of the built site). With upload-pages-artifact: false, deploy the folder from output to any host in a later step.
Moving from your own copy of Quartz
If your site is a copy of Quartz (from the template or a fork), you can move it to the action:
- Keep
content/,quartz.config.yaml,quartz.lock.json, and any changes toquartz/static/andquartz/styles/custom.scss. Changes to other Quartz files aren’t used by the action. - Optionally, shrink
quartz.config.yamltoextends: defaultand your changes (see configuration > Extending the default configuration).npx quartz plugin listandnpx quartz build --verbosein your copy show what the site uses. - Replace your deploy workflow with the one above.
Your notes and settings can stay in the same repository, or move to a new one that holds only them.