7. Ship to GitHub Pages
Export your site, host it under a repository sub-path, and publish it with a GitHub Actions workflow.
On this page
dotnet run -c Release -- --bevel-build
This is the last step. You export the site as plain files and put them on GitHub Pages. You can host the same files anywhere that serves static files.
Export once by hand
bash dotnet run -c Release -- --bevel-buildBevel renders every page, writes it to
wwwroot/, and exits. You should seeindex.html,schedule/index.html, a folder for each session and speaker, andcalendar.ics. Openwwwroot/index.htmlin a browser to check it.Export with
-c Release. A Debug build runs build-time code asDevelopment, which keeps drafts. See Drafts and removing items.Add the path base
A GitHub project site lives at
https://you.github.io/bevel-conf/, not at the root. Every link has to start with/bevel-conf. The sample reads the prefix from an environment variable, so the same code works on your machine and in CI. It also setsSiteUrl, the origin of the published site, fromBEVEL_SITE_URL. The calendar feed uses it to write absolute session links:samples/Bevel.Conference/Program.cscsharp // Hosted under a sub-path (GitHub Pages project sites)? Set it here and every link and asset follows. // Pass it from the environment so the same code works locally and in CI: BEVEL_PATH_BASE=/bevel-conf builder.AddBevel(options => { options.PathBase = Environment.GetEnvironmentVariable("BEVEL_PATH_BASE") ?? ""; // The origin of the published site. The calendar feed needs it for absolute session URLs. options.SiteUrl = Environment.GetEnvironmentVariable("BEVEL_SITE_URL") ?? "https://example.com"; });Export with a path base:
bash BEVEL_PATH_BASE=/bevel-conf BEVEL_SITE_URL=https://you.github.io dotnet run -c Release -- --bevel-buildOpen
wwwroot/schedule/index.htmland look at the links. They start with/bevel-conf/. The files are not moved. Bevel still writesschedule/index.html. You upload the folder to the/bevel-conf/location.Add the workflow
Create
.github/workflows/pages.yml:.github/workflows/pages.ymlyaml name: Pages on: push: branches: [main] workflow_dispatch: permissions: contents: read pages: write id-token: write concurrency: group: pages cancel-in-progress: true jobs: build: runs-on: ubuntu-latest env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_gcServer: 0 # Serve under https://<user>.github.io/<repo>/ BEVEL_PATH_BASE: /${{ github.event.repository.name }} BEVEL_SITE_URL: https://${{ github.repository_owner }}.github.io steps: - uses: actions/checkout@v4 - uses: actions/setup-dotnet@v4 with: dotnet-version: 10.0.x - name: Export the site run: dotnet run -c Release -- --bevel-build - uses: actions/upload-pages-artifact@v3 with: path: wwwroot deploy: needs: build runs-on: ubuntu-latest environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} steps: - id: deployment uses: actions/deploy-pages@v4The workflow installs .NET, runs the export with the path base set from the repository name, uploads
wwwroot, and deploys it. If your project is not in the repository root, addworking-directoryto the export step and pointpathat that project'swwwroot.Turn on Pages
In your repository, open Settings → Pages. Under Build and deployment, set Source to GitHub Actions. Push to
main. The workflow runs, and the deploy job prints your site's URL.
Run it
Open https://<you>.github.io/<repo>/. You should see the finished site: speakers, schedule, session pages and a calendar link that works.

When something is off
- Links go to the wrong place. The path base is missing or has no leading slash. It must look like
/repo. - Missing styles. The stylesheet link did not use
Links.Asset. UseLinks.Asset("/css/site.css"). - A hand-written
href="/about"does not work. Bevel does not rewrite hand-written links in your markup. UseLinks.To<AboutPage>(), orLinks.Route("/about")for a route without a page. - The export fails with "no MapStatic route". A
Links.ToorLinks.Routecall points at a route you did not map. Fix the link or add the route. - CS8974 when you build. You wrote
href="@Links.To<HomePage>()". Add parentheses:href="@(Links.To<HomePage>())".
Next: Where to go next.