Skip to content

Commit 72a70ec

Browse files
committed
feat: update Aurora build process and configuration for Cloudflare Pages
1 parent 80f6df9 commit 72a70ec

6 files changed

Lines changed: 40 additions & 12 deletions

File tree

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,32 @@ by editing the `available` check when its first release lands.
5151
`aurora.luminusos.org` is a second build of this same project:
5252

5353
```sh
54-
npm run build:aurora # static output in dist-aurora/
55-
npm run deploy:aurora # deploy dist-aurora to Cloudflare Pages
54+
npm run build:aurora # static output in aurora/dist/
55+
npm run deploy:aurora # local/manual upload with Wrangler
5656
```
5757

5858
With `SITE_VARIANT=aurora` the Aurora Shell page becomes the site root
5959
(`/` and `/pt-br/`), cross-links point back to `https://luminusos.org`, and
60-
`dist-aurora/CNAME` is written as `aurora.luminusos.org`.
60+
`aurora/dist/CNAME` is written as `aurora.luminusos.org`.
61+
62+
Cloudflare Pages settings for `aurora.luminusos.org`:
63+
64+
| Setting | Value |
65+
| --- | --- |
66+
| Root directory | `website` |
67+
| Build command | `npm run build:aurora` |
68+
| Build output directory | `aurora/dist` |
69+
| Deploy command | leave empty |
70+
71+
The `deploy:aurora` script is only for a local/manual Wrangler upload. Do not
72+
use it as the Cloudflare Pages deploy command; Git-connected Pages deployments
73+
upload the configured output directory automatically after the build command.
74+
75+
This repository intentionally does not keep a default `wrangler.jsonc` in the
76+
Pages root. The same source tree is used by multiple Cloudflare Pages projects
77+
with different output directories, so each Pages project should use its own UI
78+
settings. The Worker config used by the manual `npm run deploy` command lives
79+
in `wrangler.worker.jsonc`.
6180

6281
## Wiki & Blog (sub-projects)
6382

@@ -80,6 +99,9 @@ npm run build:wiki
8099
npm run deploy:wiki
81100
```
82101

102+
For Git-connected Cloudflare Pages projects, use only the build command and
103+
output directory. Leave the deploy command empty there as well.
104+
83105
## License
84106

85107
MIT — see [LICENSE](LICENSE).

astro.config.mjs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ const sites = {
1111
'': 'https://luminusos.org',
1212
aurora: 'https://aurora.luminusos.org',
1313
};
14+
const outDirs = {
15+
'': './dist',
16+
aurora: './aurora/dist',
17+
};
1418
if (!(variant in sites)) {
1519
throw new Error(`Unknown SITE_VARIANT "${variant}" (expected aurora)`);
1620
}
1721

1822
export default defineConfig({
1923
site: sites[/** @type {keyof typeof sites} */ (variant)],
20-
outDir: variant ? `./dist-${variant}` : './dist',
24+
outDir: outDirs[/** @type {keyof typeof outDirs} */ (variant)],
2125
trailingSlash: 'ignore',
2226

2327
i18n: {
@@ -29,4 +33,4 @@ export default defineConfig({
2933
},
3034

3135
adapter: cloudflare()
32-
});
36+
});

aurora/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist/
2+
.astro/

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
"dev:site": "astro dev",
99
"build": "npm run build:site && npm run build:blog:site && npm run build:wiki:site && node scripts/add-embedded-routes.mjs",
1010
"build:site": "astro build",
11-
"build:aurora": "SITE_VARIANT=aurora astro build && node scripts/clean-aurora-build.mjs && echo aurora.luminusos.org > dist-aurora/CNAME",
11+
"build:aurora": "SITE_VARIANT=aurora astro build && node scripts/clean-aurora-build.mjs && echo aurora.luminusos.org > aurora/dist/CNAME",
1212
"build:blog": "astro build --root blog",
1313
"build:blog:site": "SITE_BASE=/blog SITE_URL=https://luminusos.org astro build --root blog && rm -rf dist/blog && mkdir -p dist/blog && cp -R blog/dist/. dist/blog/",
1414
"build:wiki": "astro build --root wiki",
1515
"build:wiki:site": "SITE_BASE=/wiki SITE_URL=https://luminusos.org astro build --root wiki && rm -rf dist/wiki && mkdir -p dist/wiki && cp -R wiki/dist/. dist/wiki/",
16-
"preview": "npm run build && wrangler dev",
16+
"preview": "npm run build && wrangler dev --config wrangler.worker.jsonc",
1717
"astro": "astro",
18-
"deploy": "npm run build && wrangler deploy",
19-
"deploy:aurora": "npm run build:aurora && wrangler pages deploy dist-aurora --project-name luminusos-aurora",
18+
"deploy": "npm run build && wrangler deploy --config wrangler.worker.jsonc",
19+
"deploy:aurora": "npm run build:aurora && wrangler pages deploy aurora/dist --project-name luminusos-aurora",
2020
"deploy:blog": "npm run build:blog && wrangler pages deploy blog/dist --project-name luminusos-blog",
2121
"deploy:wiki": "npm run build:wiki && wrangler pages deploy wiki/dist --project-name luminusos-wiki",
22-
"cf-typegen": "wrangler types"
22+
"cf-typegen": "wrangler types --config wrangler.worker.jsonc"
2323
},
2424
"dependencies": {
2525
"@astrojs/cloudflare": "^12.6.13",

scripts/clean-aurora-build.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { rmSync } from 'node:fs';
22

3-
const dist = new URL('../dist-aurora/', import.meta.url);
3+
const dist = new URL('../aurora/dist/', import.meta.url);
44

55
for (const path of ['aetheris', 'aurora', 'pt-br/aetheris', 'pt-br/aurora']) {
66
rmSync(new URL(path, dist), { recursive: true, force: true });

wrangler.jsonc renamed to wrangler.worker.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "node_modules/wrangler/config-schema.json",
3-
"name": "luminusos",
3+
"name": "website",
44
"compatibility_date": "2026-07-05",
55
"observability": {
66
"enabled": true

0 commit comments

Comments
 (0)