Lunet provides an official GitHub Action — lunet-io/actions/lunet-build — that builds your site and deploys it to GitHub Pages in a single step. No manual build scripts, no separate CI configuration — just add a workflow file and push.
Before the workflow can deploy, you must activate GitHub Pages in your repository settings:

That's it. GitHub will now accept deployments from workflow runs instead of requiring a dedicated branch.
Create .github/workflows/site.yml in your repository:
name: site
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
site:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.lunet.outputs.page_url }}
steps:
- id: lunet
name: Build and deploy Lunet site
uses: lunet-io/actions/lunet-build@v1
Push this file to main and your site will be built and published automatically.
Behind the scenes, lunet-build runs these steps:
lunet tool.lunet build in your site/ folder..lunet/build/www/) as a GitHub Pages artifact.The deployed URL is available as the page_url output.
If your site lives in a folder other than site/:
- uses: lunet-io/actions/lunet-build@v1
with:
site_path: docs
You can build a site from a different repository (useful for organization-level Pages sites):
- uses: lunet-io/actions/lunet-build@v1
with:
repository: my-org/my-other-repo
site_path: site
To upload the Pages artifact without deploying — for example, to add an approval step:
- uses: lunet-io/actions/lunet-build@v1
with:
deploy_pages: false
- uses: lunet-io/actions/lunet-build@v1
with:
build_command: "lunet --stacktrace build"
To serve your site under a custom domain (e.g. example.com):
Follow the GitHub Pages custom domain guide.
Set baseurl in your config.scriban to match:
site_project_baseurl = "https://example.com"
The action handles the rest — no CNAME file is needed in the build output.
| Input | Default | Description |
|---|---|---|
repository |
current repo | Repository to checkout (owner/name) |
ref |
default branch | Git ref (branch, tag, or SHA) |
token |
github.token |
Token for checkout |
checkout_path |
source |
Checkout directory |
submodules |
recursive |
Submodule checkout mode |
fetch_depth |
0 |
Fetch depth |
dotnet_version |
10.0.x |
.NET SDK version |
lunet_version |
(latest) | Lunet tool version range |
site_path |
site |
Site folder inside the repo |
build_command |
lunet build |
Build command |
output_path |
.lunet/build/www |
Output folder (relative to site_path) |
setup_pages |
true |
Run actions/configure-pages |
upload_pages_artifact |
true |
Upload output as Pages artifact |
deploy_pages |
true |
Deploy to GitHub Pages |
build, serve, and other commandslunet-io/actions on GitHub — action source and changelog