Color mode

Deployment

Riebeckite builds a static site: npm exec riebeckite build writes the publishable files to dist/. Deployment means hosting that folder. The reference target is Cloudflare Workers with static assets.

There are three deployment methods, and they are options you add over time rather than mutually exclusive choices:

Method Choose it when
Local-first (publish from your machine) You want the fastest first publish
GitHub Actions You want to deploy on every push
Content Repository split You want the vault and site in separate repositories

Local-first does not replace GitHub Actions. Add GitHub Actions when you want automation.

text
Local-first
  → publish to Cloudflare Workers from your machine
 
GitHub Actions
  → publish automatically on push
 
Content Repository split
  → keep site and content repositories separate

This beginner page covers Local-first, GitHub Actions, and adding a Custom Domain. If you want the split, see Content Repositories and Separate Content Repository.

1. First deploy from your machine (Local-first)

This is the fastest path to a public site.

  1. Create a Cloudflare account.

  2. Scaffold a site with Cloudflare Workers as the deployment choice:

    sh
    npx create-riebeckite my-site

    Choosing Cloudflare Workers includes the Wrangler dependency and wrangler.jsonc in the generated site, then asks Deploy now? after installing dependencies. Yes builds and deploys right away; Later finishes the scaffold and you run these commands afterwards:

    sh
    npm run build
    npm exec riebeckite deploy
  3. riebeckite deploy publishes dist/ to Cloudflare Workers and opens the Wrangler login in a browser on the first run. It does not build, so create dist/ with riebeckite build first. Change the Worker name by editing name in the generated wrangler.jsonc. For a site generated with Not now, install Wrangler first with npm install -D wrangler.

  4. Open the URL printed by Wrangler, such as https://<name>.<account>.workers.dev. If your Riebeckite site loads, the first deploy succeeded.

After the public URL is known, set site.baseUrl in riebeckite.config.ts to that URL, then build and deploy once more so generated URLs such as sitemap entries use the final address.

sh
npm exec riebeckite build
npm exec riebeckite deploy

Add a Custom Domain

After the first Worker deployment, run this from the site repository:

sh
npm exec riebeckite deploy domain

Enter the apex domain such as example.com, or a subdomain such as docs.example.com. The command accepts a hostname only, shows the planned change, and asks for confirmation before updating wrangler.jsonc or wrangler.json. It adds this declarative Wrangler configuration:

jsonc
{
  "routes": [
    { "pattern": "docs.example.com", "custom_domain": true }
  ]
}

Choose Deploy now to use the normal riebeckite deploy flow. Otherwise, deploy later with npm exec riebeckite deploy. Cloudflare Workers creates the DNS record and TLS certificate for a Custom Domain in a zone active in your Cloudflare account. This is different from a Worker Route: use a Custom Domain when the Worker is the origin for the site.

The command leaves wrangler.toml unchanged. Add the equivalent configuration manually when you use TOML:

toml
[[routes]]
pattern = "docs.example.com"
custom_domain = true

Before deploying, ensure the domain is in an active Cloudflare zone in the same account. A hostname with an existing CNAME record, a zone outside the account, or a non-Custom-Domain Worker Route for the hostname must be resolved first. Wildcard domains and URL paths are not Custom Domains. You can keep the workers.dev URL available by explicitly setting workers_dev = true (TOML) or "workers_dev": true (JSON) when your configuration needs it.

After Cloudflare has activated the hostname, change site.baseUrl to https://docs.example.com (or your apex domain), build, and deploy again. The domain configuration stays in version control, so GitHub Actions deploys the same Worker configuration on every push.

2. Automatic deploy with GitHub Actions

If you want deploys to run on every push, choose GitHub Actions when the CLI asks for the deployment. From the command line, the same choice is:

sh
npx create-riebeckite my-site --github-actions

This adds:

  • wrangler.jsonc
  • .github/workflows/deploy.yml

The generated workflow installs dependencies with npm ci, runs npm exec riebeckite check, builds with npm exec riebeckite build, and deploys with cloudflare/wrangler-action@v3.

Add these repository secrets in GitHub (Settings → Secrets and variables → Actions):

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID

Commit the package-lock.json created by npm install, then push to main or run the workflow manually from the Actions tab.

Add it later to a Local-first site

If you already published from your machine, you do not need to recreate the site. Run this in the project:

sh
npm exec riebeckite deploy setup

The command finds the Git repository and GitHub remote, checks the GitHub CLI and Wrangler logins, creates .github/workflows/deploy.yml from the same template, and registers CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN as repository secrets. It stops before pushing, so run git push when you are ready. Running it again is safe: an existing workflow and secrets are detected and left unchanged.

3. Advanced: separate content repository

Some teams keep the site implementation and Markdown content in separate repositories. That setup is useful for an existing Obsidian vault, separate editor/developer workflows, or different lifecycles for content and site code.

You do not need this for your first site. When you do, start with Content Repositories. The GitHub Actions automation details live in Separate Content Repository.

Next

  • Guides → — writing content, Obsidian, localization, and deployment in depth
  • Plugins → — add features by goal
  • Themes → — change the site's look

History

1 changesCollapseExpand
1 + ---
2 + title: Deployment
3 + sidebar:
4 + label: Deployment
5 + order: 50
6 + ---
7 + # Deployment
8 +
9 + Riebeckite builds a static site: `npm exec riebeckite build` writes the publishable files to `dist/`. Deployment means hosting that folder. The reference target is [Cloudflare Workers](https://workers.cloudflare.com/) with static assets.
10 +
11 + There are three deployment methods, and they are options you add over time rather than mutually exclusive choices:
12 +
13 + | Method | Choose it when |
14 + | --- | --- |
15 + | Local-first (publish from your machine) | You want the fastest first publish |
16 + | GitHub Actions | You want to deploy on every push |
17 + | Content Repository split | You want the vault and site in separate repositories |
18 +
19 + Local-first does not replace GitHub Actions. Add GitHub Actions when you want automation.
20 +
21 + ```text
22 + Local-first
23 + → publish to Cloudflare Workers from your machine
24 +
25 + GitHub Actions
26 + → publish automatically on push
27 +
28 + Content Repository split
29 + → keep site and content repositories separate
30 + ```
31 +
32 + This beginner page covers Local-first, GitHub Actions, and adding a Custom Domain. If you want the split, see [Content Repositories](../guides/content-repositories.en.md) and [Separate Content Repository](../guides/deployment/separate-content-repository.en.md).
33 +
34 + ## 1. First deploy from your machine (Local-first)
35 +
36 + This is the fastest path to a public site.
37 +
38 + 1. Create a [Cloudflare account](https://www.cloudflare.com/).
39 +
40 + 2. Scaffold a site with `Cloudflare Workers` as the deployment choice:
41 +
42 + ```sh
43 + npx create-riebeckite my-site
44 + ```
45 +
46 + Choosing `Cloudflare Workers` includes the Wrangler dependency and `wrangler.jsonc` in the generated site, then asks `Deploy now?` after installing dependencies. `Yes` builds and deploys right away; `Later` finishes the scaffold and you run these commands afterwards:
47 +
48 + ```sh
49 + npm run build
50 + npm exec riebeckite deploy
51 + ```
52 +
53 + 3. `riebeckite deploy` publishes `dist/` to Cloudflare Workers and opens the Wrangler login in a browser on the first run. It does not build, so create `dist/` with `riebeckite build` first. Change the Worker name by editing `name` in the generated `wrangler.jsonc`. For a site generated with `Not now`, install Wrangler first with `npm install -D wrangler`.
54 +
55 + 4. Open the URL printed by Wrangler, such as `https://<name>.<account>.workers.dev`. If your Riebeckite site loads, the first deploy succeeded.
56 +
57 + After the public URL is known, set `site.baseUrl` in `riebeckite.config.ts` to that URL, then build and deploy once more so generated URLs such as sitemap entries use the final address.
58 +
59 + ```sh
60 + npm exec riebeckite build
61 + npm exec riebeckite deploy
62 + ```
63 +
64 + ### Add a Custom Domain
65 +
66 + After the first Worker deployment, run this from the site repository:
67 +
68 + ```sh
69 + npm exec riebeckite deploy domain
70 + ```
71 +
72 + Enter the apex domain such as `example.com`, or a subdomain such as `docs.example.com`. The command accepts a hostname only, shows the planned change, and asks for confirmation before updating `wrangler.jsonc` or `wrangler.json`. It adds this declarative Wrangler configuration:
73 +
74 + ```jsonc
75 + {
76 + "routes": [
77 + { "pattern": "docs.example.com", "custom_domain": true }
78 + ]
79 + }
80 + ```
81 +
82 + Choose **Deploy now** to use the normal `riebeckite deploy` flow. Otherwise, deploy later with `npm exec riebeckite deploy`. Cloudflare Workers creates the DNS record and TLS certificate for a Custom Domain in a zone active in your Cloudflare account. This is different from a Worker Route: use a Custom Domain when the Worker is the origin for the site.
83 +
84 + The command leaves `wrangler.toml` unchanged. Add the equivalent configuration manually when you use TOML:
85 +
86 + ```toml
87 + [[routes]]
88 + pattern = "docs.example.com"
89 + custom_domain = true
90 + ```
91 +
92 + Before deploying, ensure the domain is in an active Cloudflare zone in the same account. A hostname with an existing CNAME record, a zone outside the account, or a non-Custom-Domain Worker Route for the hostname must be resolved first. Wildcard domains and URL paths are not Custom Domains. You can keep the `workers.dev` URL available by explicitly setting `workers_dev = true` (TOML) or `"workers_dev": true` (JSON) when your configuration needs it.
93 +
94 + After Cloudflare has activated the hostname, change `site.baseUrl` to `https://docs.example.com` (or your apex domain), build, and deploy again. The domain configuration stays in version control, so GitHub Actions deploys the same Worker configuration on every push.
95 +
96 + ## 2. Automatic deploy with GitHub Actions
97 +
98 + If you want deploys to run on every push, choose `GitHub Actions` when the CLI asks for the deployment. From the command line, the same choice is:
99 +
100 + ```sh
101 + npx create-riebeckite my-site --github-actions
102 + ```
103 +
104 + This adds:
105 +
106 + - `wrangler.jsonc`
107 + - `.github/workflows/deploy.yml`
108 +
109 + The generated workflow installs dependencies with `npm ci`, runs `npm exec riebeckite check`, builds with `npm exec riebeckite build`, and deploys with `cloudflare/wrangler-action@v3`.
110 +
111 + Add these repository secrets in GitHub (Settings → Secrets and variables → Actions):
112 +
113 + - `CLOUDFLARE_API_TOKEN`
114 + - `CLOUDFLARE_ACCOUNT_ID`
115 +
116 + Commit the `package-lock.json` created by `npm install`, then push to `main` or run the workflow manually from the Actions tab.
117 +
118 + ### Add it later to a Local-first site
119 +
120 + If you already published from your machine, you do not need to recreate the site. Run this in the project:
121 +
122 + ```sh
123 + npm exec riebeckite deploy setup
124 + ```
125 +
126 + The command finds the Git repository and GitHub remote, checks the GitHub CLI and Wrangler logins, creates `.github/workflows/deploy.yml` from the same template, and registers `CLOUDFLARE_ACCOUNT_ID` and `CLOUDFLARE_API_TOKEN` as repository secrets. It stops before pushing, so run `git push` when you are ready. Running it again is safe: an existing workflow and secrets are detected and left unchanged.
127 +
128 + ## 3. Advanced: separate content repository
129 +
130 + Some teams keep the site implementation and Markdown content in separate repositories. That setup is useful for an existing Obsidian vault, separate editor/developer workflows, or different lifecycles for content and site code.
131 +
132 + You do not need this for your first site. When you do, start with [Content Repositories](../guides/content-repositories.en.md). The GitHub Actions automation details live in [Separate Content Repository](../guides/deployment/separate-content-repository.en.md).
133 +
134 + ## Next
135 +
136 + - [Guides →](../guides/README.en.md) — writing content, Obsidian, localization, and deployment in depth
137 + - [Plugins →](../plugins/README.en.md) — add features by goal
138 + - [Themes →](../themes/README.en.md) — change the site's look
139 +