ci: add per-PR docs preview deployment to Aleph Cloud#79
Conversation
Adds a pull_request-triggered workflow that builds the docs and deploys a per-PR preview via aleph-im/web3-hosting-action@v2, using delegated signing (low-privilege CI key, owner wallet pays). The action sweeps and removes previews of closed PRs on each run, so the workflow does not listen for the closed event. Fork PRs are skipped since they cannot read repository secrets. Release deployment is left unchanged.
The aleph CLI binary installed by web3-hosting-action requires GLIBC_2.38+, which ubuntu-22.04 does not provide.
foxpatch-aleph
left a comment
There was a problem hiding this comment.
A clean, well-designed PR that adds per-PR preview deployments to Aleph Cloud. The delegated signing model is a strong security pattern — a leaked CI key cannot spend funds. The cleanup strategy (sweeping at each run rather than listening for closed) correctly avoids a race condition. Build steps mirror the existing release workflow. The fork-PR guard handles external contributions gracefully. Minor nit: consider upgrading checkout and setup-node actions to v4 to avoid Node 16 deprecation warnings on ubuntu-latest runners.
.github/workflows/pr-preview.yml (line 42): Consider bumping to actions/checkout@v4 — v3 runs on Node 16, which is deprecated on ubuntu-latest (24.04+).
.github/workflows/pr-preview.yml (line 45): Consider bumping to actions/setup-node@v4 for the same Node 16 deprecation reason.
|
Deployed on:
|
v3 runs on the deprecated Node 16 runtime on ubuntu-latest (24.04+).
Latest stable; v4 (Node 20) is entering deprecation.
foxpatch-aleph
left a comment
There was a problem hiding this comment.
Well-structured PR that adds a per-PR preview deployment workflow using aleph-im/web3-hosting-action@v2. The delegated signing model (low-privilege CI key, owner wallet holds credits) follows least-privilege principles. Fork PRs are handled gracefully. The cleanup strategy (sweep at each run, no closed trigger) is deliberate and well-documented. Build steps mirror the existing release workflow with an upgrade to checkout/setup-node@v4. One minor note: the first-PR-after-last-to-close will clean up the previous orphan before deploying, which is a reasonable tradeoff clearly explained in the comments.
.github/workflows/pr-preview.yml (line 6): Cleanup relies on subsequent PR activity. The last PR to close leaves an orphan until another PR event. This is a reasonable tradeoff and well-documented, but worth being aware of.
Adds a
pull_request-triggered workflow (.github/workflows/pr-preview.yml) that builds the docs and deploys a per-PR preview to Aleph Cloud viaaleph-im/web3-hosting-action@v2, implementing the auto-deployment flow documented in #77. Release deployment is left unchanged.Design choices
ALEPH_CI_PRIVATE_KEYsecret) while the owner wallet (ALEPH_OWNER_ADDRESSvariable) holds the credits and owns the sites. A leaked CI key cannot spend funds; its authorization is scoped tostore,aggregateon thewebsites,domainsaggregates only.closedtrigger: the action sweeps and removes previews of closed PRs at the start of every run, so cleanup happens through ongoing PR activity. Listening forclosedwould make it reap then immediately redeploy the just-closed preview.npm install,npm run docs:build, output atdocs/.vitepress/dist).Required configuration (already set up)
ALEPH_CI_PRIVATE_KEY: dedicated CI signer key.ALEPH_OWNER_ADDRESS: owner wallet address (must hold credits).Notes