feat: add GitHub Actions CI and support hosting under a subpath

Mirrors the GitLab pipeline — typecheck, tests, feed sanity — and adds a
Pages deploy.

Pages serves from /<repo>/, and the app used absolute asset paths, so that
job would have shipped a site that 404s on everything. Assets now resolve
against a <base href> the build substitutes, the feed URL resolves against
document.baseURI so deep links work too, and the service worker derives its
paths from its own registration scope. Root-hosted builds are unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5 committed 2026-08-15 01:22:22 +02:00
1 parent 517066dc65
commit b86794a62d
8 files changed
+173 -17

No files matched your search

+4 -1
View File
@@ -13,7 +13,10 @@ export type FeedState =
* worse than one that asks you to reload.
*/
export async function fetchFeed(signal?: AbortSignal): Promise<EventFeed> {
const res = await fetch("/data/events.v1.json", { signal: signal ?? null });
// Resolved against <base>, so this is correct at a domain root, under a
// GitHub Pages subpath, and on a deep link alike.
const feedUrl = new URL("data/events.v1.json", document.baseURI);
const res = await fetch(feedUrl, { signal: signal ?? null });
if (!res.ok) {
throw new Error(`Feed request failed (${res.status}).`);
}