Skip to content

ci: add per-PR docs preview deployment to Aleph Cloud#79

Merged
odesenfans merged 4 commits into
mainfrom
feature/pr-preview-deploys
Jun 15, 2026
Merged

ci: add per-PR docs preview deployment to Aleph Cloud#79
odesenfans merged 4 commits into
mainfrom
feature/pr-preview-deploys

Conversation

@odesenfans

@odesenfans odesenfans commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Adds a pull_request-triggered workflow (.github/workflows/pr-preview.yml) that builds the docs and deploys a per-PR preview to Aleph Cloud via aleph-im/web3-hosting-action@v2, implementing the auto-deployment flow documented in #77. Release deployment is left unchanged.

Design choices

  • Delegated signing: signs with a low-privilege CI key (ALEPH_CI_PRIVATE_KEY secret) while the owner wallet (ALEPH_OWNER_ADDRESS variable) holds the credits and owns the sites. A leaked CI key cannot spend funds; its authorization is scoped to store,aggregate on the websites,domains aggregates only.
  • No closed trigger: the action sweeps and removes previews of closed PRs at the start of every run, so cleanup happens through ongoing PR activity. Listening for closed would make it reap then immediately redeploy the just-closed preview.
  • Fork-PR guard: fork PRs cannot read repository secrets, so they are skipped cleanly instead of failing on every external contribution.
  • Build steps mirror the existing release workflow (Node 18, npm install, npm run docs:build, output at docs/.vitepress/dist).

Required configuration (already set up)

  • Secret ALEPH_CI_PRIVATE_KEY: dedicated CI signer key.
  • Variable ALEPH_OWNER_ADDRESS: owner wallet address (must hold credits).
  • One-time delegation from the owner wallet authorizing the CI signer (see comment block at the top of the workflow file).

Notes

  • Broken links do not fail the build in CI (matches existing release behavior); a link-check gate would be a separate change.
  • This PR is itself the first live test of the preview deploy.

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 foxpatch-aleph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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@v4v3 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.

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deployed on:

Preview for this pull request, updated on every commit and removed once the PR is closed.

v3 runs on the deprecated Node 16 runtime on ubuntu-latest (24.04+).
Latest stable; v4 (Node 20) is entering deprecation.

@foxpatch-aleph foxpatch-aleph left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@odesenfans odesenfans merged commit dd18c9f into main Jun 15, 2026
1 check passed
@odesenfans odesenfans deleted the feature/pr-preview-deploys branch June 15, 2026 15:33
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