Sarde builds a static site that works on any hosting provider. Run sarde build to generate the output, then deploy the result to your platform of choice.
Build for production
sarde build→ The terminal prints a summary:
Built in 320 ms Output: /path/to/my-site/distThe dist/ directory contains the complete site: HTML pages, CSS, JavaScript, images, feeds, sitemap, and search index. Upload this directory to any static hosting provider.
Override the output directory with --output or build.output in sarde.yaml.
GitHub Pages
Sarde has built-in GitHub Pages deployment. Add the deploy config to sarde.yaml:
deploy: provider: github branch: gh-pagesBuild and deploy:
sarde buildsarde deploy→ The terminal prints:
Deploying with github-pages...Deploy complete.This force-pushes the dist/ contents to the gh-pages branch. In the GitHub repository settings, configure Pages to serve from that branch.
Netlify
Build the site, then deploy using the Netlify CLI:
sarde buildnpx netlify deploy --prod --dir distTo generate a Netlify-compatible _redirects file for any configured redirects or page aliases, set the redirect format in sarde.yaml:
deploy: redirect_format: netlifyCloudflare Pages
Build the site, then deploy using Wrangler:
sarde buildnpx wrangler pages deploy dist --project-name my-siteAlternatively, connect the Git repository in the Cloudflare dashboard. Set the build command to sarde build and the output directory to dist.
Vercel
Build the site, then deploy using the Vercel CLI:
sarde buildnpx vercel deploy --prod distTo generate a Vercel-compatible vercel.json with redirect rules, set the redirect format:
deploy: redirect_format: vercelAlternatively, connect the Git repository in the Vercel dashboard. Set the build command to sarde build and the output directory to dist.
Custom deployment
The custom provider runs any shell command with the DIST_DIR environment variable set to the absolute path of the output directory.
deploy: provider: custom command: "rsync -avz $DIST_DIR/ user@server:/var/www/html/"sarde buildsarde deployThis also works as a wrapper for provider CLIs:
deploy: provider: custom command: "npx netlify deploy --prod --dir $DIST_DIR"CI/CD
A minimal GitHub Actions workflow that builds and deploys on every push to main:
name: Deployon: push: branches: [main]jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install Sarde run: curl -sSfL https://raw.githubusercontent.com/getsarde/sarde/main/install.sh | sh - name: Build and deploy run: | sarde build sarde deploy --provider githubThe github deployer auto-configures a git identity if none is set, so this works in fresh CI environments without additional setup.
See deploy in CLI Commands for all available flags, and deploy in Configuration for all config options.