Deployment

lyt

Deploy your static site to any hosting provider.

How It Works

lyt outputs pure static files to ./dist/. Any static host can serve them.

lyt build

This creates:

dist/
├── index.html
├── about.html
├── blog/
│   └── post-name/
│       └── index.html
├── base.css
├── tokens.css
└── sitemap.xml

Netlify (from GitHub Actions)

Build on GitHub, deploy to Netlify:

  1. Enable GitHub Pages in repo settings → Pages → Source: GitHub Actions
  2. Create .github/workflows/netlify.yml:
name: Deploy to Netlify
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.21'
      
      - name: Build
        run: |
          cd engine
          go run . build
      
      - name: Deploy
        uses: nwtgck/actions-netlify@v2.0
        with:
          publish-dir: './dist'
          production-branch: main
          github-token: ${{ secrets.GITHUB_TOKEN }}
          deploy-message: "Deploy from GitHub Actions"
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
  1. Add NETLIFY_AUTH_TOKEN and NETLIFY_SITE_ID secrets in GitHub

Vercel (from GitHub Actions)

Build on GitHub, deploy to Vercel:

  1. Create .github/workflows/vercel.yml:
name: Deploy to Vercel
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.21'
      
      - name: Build
        run: |
          cd engine
          go run . build
      
      - name: Deploy
        uses: amondnet/vercel-action@v25
        with:
          vercel-token: ${{ secrets.VERCEL_TOKEN }}
          vercel-org-id: ${{ secrets.ORG_ID }}
          vercel-project-id: ${{ secrets.PROJECT_ID }}
          vercel-args: '--prod'
  1. Add Vercel secrets in GitHub settings

Cloudflare Pages (from GitHub Actions)

Build on GitHub, deploy to Cloudflare:

  1. Create .github/workflows/cloudflare.yml:
name: Deploy to Cloudflare
on:
  push:
    branches: [main]
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.21'
      
      - name: Build
        run: |
          cd engine
          go run . build
      
      - name: Deploy
        uses: cloudflare/pages-action@v1
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          projectName: your-project
          directory: dist
  1. Add Cloudflare secrets in GitHub settings

GitHub Pages

Create .github/workflows/deploy.yml:

name: Deploy

on:
  push:
    branches: [main]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Setup Go
        uses: actions/setup-go@v5
        with:
          go-version: '1.21'
      
      - name: Build
        run: |
          cd engine
          go build -o lyt .
          cd ..
          ./engine/lyt build
      
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./dist

VPS / rsync

Deploy to VPS

Build locally or in CI, then rsync:

cd engine && go run . build
rsync -avz --delete dist/ user@vps:/var/www/yoursite/

Or use SSH in CI:

- name: Deploy
  run: |
    rsync -avz --delete dist/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/var/www/site/

CDN / Storage

Object Storage + CDN

Upload dist/ to S3/Cloudflare R2/Backblaze, then connect CDN.

AWS S3 example:

aws s3 sync dist/ s3://your-bucket --delete

Then configure your CDN to point to the bucket.

Environment Variables

For per-environment config (e.g., different URLs), use shell variables:

# In your CI
export SITE_URL="https://staging.example.com"
cd engine && go run . build

Reference in templates via build-time substitution if needed.

Need Help?

Questions? Check the docs or open an issue on GitHub.

View on GitHub