# Deployment

URL: /bengal/docs/ship/deployment/
Section: deployment
Description: Deploy your Bengal site to production

---

> For a complete page index, fetch /bengal/llms.txt.

Ship static HTML from Bengal to GitHub Pages, Netlify, Vercel, or any host that
serves files from a directory.

Note

Do I need this? Yes when you are ready to publish beyond`bengal serve`.
Skip until you have content to ship — local preview does not need deployment
config. For CI wiring, also see
GitHub Actions tutorial (/bengal/docs/tutorials/operations/automate-with-github-actions/).

Bengal generates static HTML, CSS, and JavaScript. Run a production build, upload
the`public/`directory, and point your host at it.

## The Production Build

When you are ready to ship, run the production build:

BASH

```
bengal build --environment production --strict --clean-output
```
Output goes to `public/`. Use `--fast`for CI builds when you do not need verbose timing output.

This command:

- Loads configuration from`config/environments/production.yaml`(if it exists)

- Minifies HTML output (enabled by default)

- Generates the`public/`directory with your complete site

### Common Build Flags

Flag
Description
Use Case

`--environment production`
Loads production config overrides.
Always use for shipping.

`--strict`
Fails the build on template errors.
Highly Recommended for CI/CD.

`--clean-output`
Cleans the`public/`directory before building.
Recommended to avoid stale files.

`--fast`
Maximum performance (quiet output, full parallelism).
Fast CI builds.

`--verbose`
Shows detailed build output (phase timing, stats).
Useful for debugging CI failures.

Example full command for CI matches the snippet above — add`--fast`when you want maximum CI throughput with quiet output.

## GitHub Pages

Deploy using GitHub Actions. Create`.github/workflows/deploy.yml`:

yaml
YAML

```
name: Deploy to GitHub Pages

on:
  push:
    branches: [main]

permissions:
  contents: read
  pages: write
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.14'

      - name: Install Bengal
        run: pip install bengal

      - name: Build Site
        run: bengal build --environment production --strict --clean-output

      - name: Upload artifact
        uses: actions/upload-pages-artifact@v3
        with:
          path: './public'

  deploy:
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    runs-on: ubuntu-latest
    needs: build
    steps:
      - name: Deploy to GitHub Pages
        id: deployment
        uses: actions/deploy-pages@v4
```
## Netlify

Create a`netlify.toml`in your repository root:

toml
TOML

```
[build]
  publish = "public"
  command = "bengal build --environment production"

[build.environment]
  PYTHON_VERSION = "3.14"
```
## Vercel

Configure your project:

- Build Command:`bengal build --environment production`

- Output Directory:`public`

- Ensure your`requirements.txt` includes `bengal`.

## Automatic Platform Detection

Bengal auto-detects your deployment platform and configures`baseurl`automatically:

Platform
Detection
Baseurl Source

GitHub Pages
`GITHUB_ACTIONS=true`
Inferred from`GITHUB_REPOSITORY`

Netlify
`NETLIFY=true`
`URL` or `DEPLOY_PRIME_URL`

Vercel
`VERCEL=true`
`VERCEL_URL`

You can override auto-detection with the`BENGAL_BASEURL`environment variable:

BASH

```
BENGAL_BASEURL="https://custom-domain.com" bengal build --environment production
```
## Pre-Deployment Checklist

Before you merge to main or deploy:

- Run`bengal config doctor`: Checks for common configuration issues.

- Run`bengal build --strict`locally: Ensures no template errors.

- Run`bengal check`: Runs health checks on your site content.

- Check`config/environments/production.yaml`: Ensure your `baseurl`is set to your production domain.

yaml
YAML

```
# config/environments/production.yaml
site:
  baseurl: "https://example.com"
```

Seealso

- Configuration (/bengal/docs/ship/configuration/) — environment-specific settings

- Multi-Variant Builds (/bengal/docs/ship/configuration/variants/) — OSS vs Enterprise, brand variants

- Performance (/bengal/docs/ship/performance/) — optimize build times

- Validation (/bengal/docs/ship/validate/) — health checks before you ship

Internationalization (i18n) (/bengal/docs/build-sites/structure/i18n/)

Multi-language sites with gettext PO/MO, RTL support, and translation workflows

Related

Automate with GitHub Actions (/bengal/docs/tutorials/operations/automate-with-github-actions/)

Set up automated builds, testing, and deployments using GitHub Actions

Related

Ship (/bengal/docs/ship/)

Build configuration, SEO/discovery, output formats, and deployment

Related

Analysis (/bengal/docs/build-sites/structure/analysis/)

Site structure analysis tools

Related

Versioned Documentation (/bengal/docs/build-sites/structure/versioning/)

Serve multiple versions of your documentation from a single site

Related

deployment (/bengal/tags/deployment/)

hosting (/bengal/tags/hosting/)

ci-cd (/bengal/tags/ci-cd/)

persona-operator (/bengal/tags/persona-operator/)
