Skip to content

Commit a116dc6

Browse files
Refresh browser data in deploy, fix search blog warning, document rrsync paths (#233)
Add npx update-browserslist-db step before the build. Set indexBlog:false to stop the search plugin scanning for a missing blog/ dir (the blogDir warning) and disable the unused classic blog plugin. Document how the rrsync root and DEPLOY_PATH combine in the workflow header.
1 parent 052ee77 commit a116dc6

2 files changed

Lines changed: 35 additions & 6 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,40 @@ name: Deploy documentation
99
# DEPLOY_SSH_KEY Private SSH key (ed25519) for the deploy user. The matching
1010
# public key goes into the deploy user's ~/.ssh/authorized_keys
1111
# on the server, ideally locked to rrsync, e.g.:
12-
# command="rrsync -wo /var/www/docu/htdocs",restrict ssh-ed25519 AAAA...
13-
# DEPLOY_HOST Server hostname or IP (e.g. docs.humhub.org)
12+
# command="rrsync -wo <RRSYNC_ROOT>",restrict ssh-ed25519 AAAA...
13+
# DEPLOY_HOST Server hostname or IP
1414
# DEPLOY_USER Deploy user name on the server
1515
# DEPLOY_KNOWN_HOSTS Output of `ssh-keyscan -H <host>` — pins the server key so
1616
# the connection cannot be MITM'd.
1717
# Optional:
1818
# DEPLOY_PORT SSH port (defaults to 22)
19-
# DEPLOY_PATH Destination path. Use "." when the key is locked to rrsync
20-
# (the path is relative to the rrsync root); use an absolute
21-
# path like "/var/www/docu/htdocs" if the key is unrestricted.
22-
# Defaults to ".".
19+
# DEPLOY_PATH Destination directory for the built site (defaults to ".").
20+
# See "How rrsync root and DEPLOY_PATH combine" below.
21+
#
22+
# How rrsync root and DEPLOY_PATH combine
23+
# ---------------------------------------
24+
# When the deploy key is locked to rrsync (recommended), rrsync confines rsync to
25+
# one directory — the "rrsync root", the path given in the authorized_keys line:
26+
# command="rrsync -wo <RRSYNC_ROOT>",restrict ssh-ed25519 AAAA...
27+
# rrsync then interprets DEPLOY_PATH *relative to that root* and joins the two.
28+
# The site is written to: <RRSYNC_ROOT>/<DEPLOY_PATH>
29+
#
30+
# IMPORTANT: DEPLOY_PATH must be relative. An absolute path (one starting with "/")
31+
# gets re-rooted under RRSYNC_ROOT and points nowhere, so rsync fails with
32+
# 'mkdir "..." failed: No such file or directory'. Use "." to write into the root
33+
# itself, or a sub-directory name to write one level below it.
34+
#
35+
# RRSYNC_ROOT (authorized_keys) DEPLOY_PATH writes to
36+
# ----------------------------- ----------- -----------------------------
37+
# <root>/webroot . <root>/webroot (tightest)
38+
# <root> webroot <root>/webroot
39+
# <root> staging <root>/staging
40+
#
41+
# The RRSYNC_ROOT must already exist and be writable by the deploy user; rsync
42+
# only creates the final DEPLOY_PATH sub-directory, not missing parents. Prefer
43+
# jailing rrsync directly to the target dir (DEPLOY_PATH=".") so the key can
44+
# write nowhere else. Note: --delete removes anything in the target not present
45+
# in build/, so keep unrelated files (e.g. /.well-known) out of that directory.
2346

2447
on:
2548
# Enable automatic deploys on push once the server-side deploy setup is done.
@@ -54,6 +77,9 @@ jobs:
5477
- name: Install dependencies
5578
run: npm install
5679

80+
- name: Refresh browser data
81+
run: npx update-browserslist-db@latest
82+
5783
- name: Build
5884
run: npm run build
5985

docusaurus.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = {
1414
require.resolve("@easyops-cn/docusaurus-search-local"),
1515
({
1616
hashed: true,
17+
// No blog on this site; don't scan for a blog/ dir to index.
18+
indexBlog: false,
1719
}),
1820
],
1921
],
@@ -155,6 +157,7 @@ module.exports = {
155157
editUrl:
156158
'https://github.com/humhub/documentation/edit/master/',
157159
},
160+
blog: false,
158161
theme: {
159162
customCss: require.resolve('./src/css/custom.css'),
160163
},

0 commit comments

Comments
 (0)