GitHub Pages
Both are the static output under another name. Nothing here runs a server, so useDraftMode, server routes and the other things static drops are dropped the same way.
Reference
| Preset | github-pages |
| Runs on | GitHub Pages |
event.runtime.name | static |
| Server target | bun |
| Lifetime, startup | process, load |
Output
.output/
hamur.json
public/ the prerendered pages
.nojekyll
404.html
Config keys
This preset has no key of its own; app.baseURL matters for a project site.
Detection
The build selects it when GITHUB_PAGES and GITHUB_ACTIONS are both set; GITHUB_ACTIONS alone selects nothing, because every GitHub Actions job sets it.
Deploy command
No hamur deploy command: it exits 1 for this preset. Upload .output/public/ with actions/upload-pages-artifact and publish it with actions/deploy-pages.
Limits
- Does not run: WebSockets and
server.syncedState,server.pubsub, streamed answers,server.metrics, image transforms at run time, privateapp/env.tsentries read at run time, Durable Object classes. - It is the
staticoutput: server routes,proxy,cors,swrandcacherules andserver.fallbackProxyare dropped with a warning.
The levels are the features of the preset: hamur build warns or fails when the app uses a feature the preset does not run (see Preset features).
--preset github-pages (with hamur generate --preset github-pages) writes .output/public/ with the prerendered pages, 404.html and an empty .nojekyll. It is chosen when both GITHUB_PAGES and GITHUB_ACTIONS are set, or by name; GITHUB_ACTIONS alone selects nothing, because every GitHub Actions job sets it.
.nojekyllturns off the Jekyll build that GitHub Pages runs on a published branch or folder; Jekyll drops files and directories whose names start with an underscore, which would remove_hamur/and every script and style with it. GitHub's publishing source page says an external CI build that commits to a branch "typically include[s] a.nojekyllfile".404.htmlis what GitHub Pages answers for a path that matches no file; it sits at the root of the published folder.- A project site is served under
/<repository>/. Withapp.baseURLunset andGITHUB_REPOSITORY=owner/repo, the build logsapp.baseURL is "/"; a project site is served under "/repo/"and changes nothing; set the base yourself:
export default defineConfig({ app: { baseURL: "/repo/" } })
Upload .output/public/ with actions/upload-pages-artifact and publish it with actions/deploy-pages.