Skip to content

[test] deploy-zh-cn.py --deploy wraps rclone - #4

Closed
cofyc wants to merge 10 commits into
masterfrom
test/deploy-zh-cn-wrapper
Closed

cofyc wants to merge 10 commits into
masterfrom
test/deploy-zh-cn-wrapper

Conversation

@cofyc

@cofyc cofyc commented Sep 30, 2026

Copy link
Copy Markdown

Testing only; will be closed. Verifies the rclone wrapper (scripts/deploy-zh-cn.py --deploy) with a real deploy before updating #1 and omacom#406. The TEMPORARY commit enables deploying from this branch.

dhh and others added 10 commits September 28, 2026 13:08
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
 4 files changed, 17 insertions(+), 17 deletions(-)
 5 files changed, 24 insertions(+), 23 deletions(-)
 4 files changed, 32 insertions(+), 32 deletions(-)
 3 files changed, 6 insertions(+), 6 deletions(-)
 6 files changed, 57 insertions(+), 23 deletions(-)
omarchy.cn serves traffic from mainland China, so the zh-CN edition is
deployed to an Aliyun OSS bucket in a mainland region.

It is additive and inert by default. The English GitHub Pages pipeline in
pages.yml, the locale registry, and every other locale's deployment path are
untouched. Deploying is enabled by configuring where to deploy: without the
OMARCHY_CN_OSS_HOST variable the deploy job skips instead of failing, so the
workflow does nothing until a repository opts in with that variable and the
two credential secrets.

That variable is the bucket domain name, `<bucket>.oss-<region>.aliyuncs.com`,
which is the whole destination in one value: the bucket is its first label and
the endpoint is the remainder, so the two cannot disagree.

scripts/deploy-zh-cn.py is the one entry point. --check refuses a build with a
mismatched CNAME, a missing required file or a symlink, without network or
credentials; the build job runs it. --deploy HOST runs the same check, then
uploads with rclone; the deploy job runs it. The expected CNAME comes from
src/i18n/locales.json rather than a hardcoded host, so the check follows the
registry when the domain changes.

rclone is pinned by version and checked against a SHA-256 recorded in the
workflow before it is unpacked. Its remote is defined entirely in the
environment, so no config file is written and no credential enters argv. The
version is held in OMARCHY_RCLONE_VERSION rather than RCLONE_VERSION: rclone
maps every RCLONE_<FLAG> variable onto the matching flag, and would read that
one as --version.

Every pass is --checksum, which compares the MD5 rclone reads from the bucket
listing, so an unchanged file is skipped without a request of its own. That
matters at this size -- the build is around 5,500 files and 158 MB, almost
none of which changes between deployments. --size-only would skip more cheaply
still, but it cannot see an edit that leaves a file the same length.

Three copies then one sync, because --header-upload takes one value per
invocation: hashed assets immutable, other assets briefly, HTML no-cache. The
final sync carries no filter and no header and exists only to delete what the
build dropped; it copies nothing, because the passes above already did. It
stays unfiltered so that deletion is complete: rclone ignores excluded files on
both sides, so a filtered sync would leave stale objects outside the filter in
place. A failed pass stops the rest, so nothing is deleted after a failed
upload.

The build job leaves lint, typecheck and tests to pages.yml, which runs them on
the same events and whose npm test already discovers scripts/test_*.py, so this
job only does the zh-CN-specific work.

The deploy job pins its actions to commit SHAs because it is the job that holds
the deploy credentials.
@cofyc
cofyc deployed to omarchy-cn September 30, 2026 02:35 — with GitHub Actions Active
@cofyc

cofyc commented Sep 30, 2026

Copy link
Copy Markdown
Author

Test passed: run 36660515421 deployed via scripts/deploy-zh-cn.py --deploy (3 copies + sync, 187 uploaded, 3 deleted). Closing.

@cofyc cofyc closed this Sep 30, 2026
@cofyc
cofyc deleted the test/deploy-zh-cn-wrapper branch September 30, 2026 02:39

This branch was successfully deployed

1 active deployment
omarchy-cn — 4f2de8d2 Deployed Sep 30, 2026 by cofyc via deploy #59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants