Deploy Your Site
Once you've built your Kiln site, deploying it is straightforward. Static sites can be hosted anywhere.
Build Output
Running kiln build generates a _site/ directory with:
- Static HTML files
- CSS and JavaScript
- Images and other assets
This entire directory is what you deploy.
GitHub Pages
GitHub Pages is perfect for Kiln sites hosted on GitHub:
- Push your site to a GitHub repository
- In repository settings, enable GitHub Pages
- Set the source branch (usually
mainorgh-pages) - Your site is live at
https://username.github.io/repo
Automate this with GitHub Actions:
name: Build and Deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '10.x'
- run: dotnet run --project src/Kiln.Cli -- build .
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_site
Azure Static Web Apps
Azure SWA offers global distribution and edge caching:
- Create a Static Web App in Azure Portal
- Connect your GitHub repository
- Configure the build output directory:
_site - Deploy automatically on every push
Netlify
Netlify's drag-and-drop interface makes deployment simple:
- Create a
netlify.toml:[build] command = "dotnet run --project src/Kiln.Cli -- build ." publish = "_site" - Connect your GitHub repository in Netlify Dashboard
- Your site is live with automatic deployments
Vercel
Vercel works similarly to Netlify:
- Import your GitHub project
- Set build command:
dotnet run --project src/Kiln.Cli -- build . - Set output directory:
_site - Deploy with one click
Custom Servers
For any web server (Apache, Nginx, custom VPS):
- Build locally:
kiln build - Upload
_site/directory via FTP, SCP, or Git - Configure your web server to serve the content
- Optionally set up automated deployments with webhooks
Performance Tips
- Enable gzip compression in your web server
- Use a CDN for global distribution
- Set proper cache headers for static assets
- Minify CSS and JavaScript (optional, can be added as build step)
Deploying a Kiln site is as simple as uploading static files. Choose the platform that fits your needs!