Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ The deployment token comes from a local `cloudhal deploy` (`.cloudhal/deploy/sec

## Domains

`cloudhal.com` serves the site; Studio runs on the admin Worker's workers.dev address. `www.cloudhal.com` should 301 to `https://cloudhal.com` through a Cloudflare Redirect Rule on the zone.
`cloudhal.com` serves the site and `studio.cloudhal.com` serves Studio (`domains` in `cloudhal.json`; the deploy adds both as Workers custom domains, which turns the workers.dev addresses off). `www.cloudhal.com` should 301 to `https://cloudhal.com` through a Cloudflare Redirect Rule on the zone.
3 changes: 2 additions & 1 deletion cloudhal.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"available": false
},
"domains": {
"site": "cloudhal.com"
"site": "cloudhal.com",
"studio": "studio.cloudhal.com"
}
}
8 changes: 4 additions & 4 deletions scripts/post-deploy-check.mjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// After `cloudhal deploy` in Workers Builds: the site and Studio must answer. If either does not
// within ~2 minutes, both Workers are rolled back to their previous version and the build fails,
// so a bad release never stays live on cloudhal.com.
// within ~3 minutes (a new custom domain may still wait for its certificate), both Workers are
// rolled back to their previous version and the build fails, so a bad release never stays live.
import { execFileSync } from "node:child_process";

const CHECKS = [
{ name: "site", url: "https://cloudhal.com/", worker: "cloudhal-com-site" },
{ name: "studio", url: "https://cloudhal-com-admin.yemek.workers.dev/api/health", worker: "cloudhal-com-admin" },
{ name: "studio", url: "https://studio.cloudhal.com/api/health", worker: "cloudhal-com-admin" },
];

async function healthy(url) {
for (let i = 0; i < 12; i++) {
for (let i = 0; i < 18; i++) {
try {
const res = await fetch(url, { redirect: "manual", headers: { "cache-control": "no-cache" } });
if (res.status === 200) return true;
Expand Down
Loading