ci: label-gated Cloudflare previews and a visible site version #18
No reviewers
Labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Site!18
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/previews-and-version"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Cloudflare previews on CircleCI, like Forgejo's today, but only when asked for, so drive-by PRs don't spend Cloudflare usage. And a visible site version, to see what's live.
What changed
previewlabel get a Cloudflare preview version (wrangler versions upload --preview-alias pr-<n>) and one comment: the PR preview link and "this commit on its own" link, aspreview.ymlposts. The job checks the label first and stops before any Cloudflare call without it. The label takes effect on the next push, because CircleCI gets push events, not label events. PR content enters only aspublic/viagit archive, wrangler config and lockfiles come from main, and installs use--ignore-scripts. Not part ofgate. Logs asite-previewdeploy marker.artifact_previewpipeline parameter, API run), so a PR without the label runs only lint, test andgate. Fork PRs keep the artifact preview until cutover; forks never get Cloudflare tokens./version.json(version, commit, build time), stamped at build time asYYYY.MM.DD.<run>+<sha7>, in CircleCI's deploy and previews and in Forgejo'sdeploy.ymlandpreview.yml, so the live site shows its version now. The repo copy says "dev". Deploy markers use the same version string.docs/ci.md.Testing
circleci config validate, orb conftest policies (16 pass), routing checked for every event,mise run lint(actionlint) andmise run test. Live test on this PR: it carries thepreviewlabel, so the run should post the Cloudflare preview comment.Preview: https://pr-18-magicbean-site.hckr-5e0.workers.dev
This commit (
e0db259383) on its own: https://5eea07b9-magicbean-site.hckr-5e0.workers.devPreview: https://pr-18-magicbean-site.hckr-5e0.workers.dev
This commit (
e0db259383) on its own: https://529c58a9-magicbean-site.hckr-5e0.workers.devc651c7b08a87077645a4