MDL MDL
Deploy

Deploy MDL sites

MDL builds static files, so any site can ship through GitHub Pages, Netlify, Vercel, Cloudflare Pages, object storage, or a plain web server.

Preflight

Run the same checks locally that you expect CI to run:

mdl check
        mdl format --check
        mdl build
        

Confirm that the generated dist/ folder contains the pages, CSS, scripts, assets, manifest, and source-map sidecars you expect.

Build output

In a generated app, mdl build writes to the configured output folder:

mdl build
        

Common output looks like:

dist/index.html
        dist/app.css
        dist/scripts/app.js
        dist/assets/
        dist/mdl-output-manifest.json
        dist/index.html.mdlmap.json
        

Any static host

Use these settings when the host can run Node and your project uses the npm package:

Install command: npm ci
        Build command: npm exec -- mdl build
        Publish directory: apps/my-mdl-site/dist
        

If the host cannot run MDL, build locally or in CI and upload the generated dist/ folder.

If you publish that folder below another path, such as https://example.com/getmdl/, switch local root links to relative output links:

{
          "routing": {
            "links": "relative"
          }
        }
        

GitHub Pages

GitHub Pages can deploy from Actions. A minimal workflow checks out the repo, installs dependencies, builds the MDL site, uploads dist, and deploys it.

checkout repository
        setup Node LTS with npm cache
        run npm ci
        run npm exec -- mdl build apps/my-mdl-site
        upload apps/my-mdl-site/dist as the Pages artifact
        deploy the uploaded Pages artifact
        

In GitHub repository settings, set Pages source to GitHub Actions.

Custom domains

For GitHub Pages, add a CNAME file to the published output or list it in assets so MDL copies it:

CNAME
        
{
          "assets": [
            "assets",
            "CNAME"
          ]
        }
        

Point the apex domain to your host using its documented records. For www, add a CNAME record to the host-provided domain, then choose whether www redirects to the apex or the apex redirects to www.

This docs site

The public docs site for getmdl.site lives in site/. From this repository:

cargo build -p mdl-cli --release
        cd site
        ../target/release/mdl build
        

This repo includes .github/workflows/deploy-site.yml. On pushes to main, it builds the MDL CLI, runs mdl build inside site/, uploads site/dist, and deploys with GitHub Pages.

The site/CNAME file contains:

getmdl.site