quartz-research-note/content/hosting.md

51 lines
1.3 KiB
Markdown

---
title: Hosting
---
Quartz effectively turns your Markdown files and other resources into a bundle of HTML, JS, and CSS files (a website!).
However, if you'd like to publish your site to the world, you need a way to host it online. This guide will detail how to deploy with either GitHub Pages or Cloudflare pages but any service that allows you to deploy static HTML should work as well (e.g. Netlify, Replit, etc.)
## GitHub Pages
Like Quartz 3, you can deploy the site generated by Quartz 4 via GitHub Pages.
In your local Quartz, create a new file `quartz/.github/workflows/deploy.yaml`:
```yaml title="quartz/.github/workflows/deploy.yaml"
name: Deploy to GitHub Pages
on:
push:
branches:
- v4-alpha
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for git info
- uses: actions/setup-node@v3
with:
node-version: 18.14
- name: Install Dependencies
run: npm ci
- name: Build Quartz
run: npx quartz build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
publish_branch: master # deploying branch
cname: quartz.jzhao.xyz
```
Then, the next time you
## Cloudflare Pages