# Deployment

## Deployment & Launch

Covena builds a static site into `dist/`, so it runs on any static host. It ships ready-made settings for **Netlify** (`netlify.toml`), **Vercel** (`vercel.json`, `vercel.sh`), and **Cloudflare Pages** (`wrangler.toml`). The site needs no account, database, or environment variables.

| Setting          | Value                     |
| ---------------- | ------------------------- |
| Build command    | `npm run build`           |
| Output directory | `dist`                    |
| Node.js version  | 22.12 or later            |
| Package manager  | npm (`package-lock.json`) |

### Before You Launch
Go through this list once. Each item links to the page that explains it. `PUBLIC-VALUES-NEEDED.md` in the theme folder lists every demo value and the file it lives in, if you want the same list as a file.

**Address and identity**

- [ ] `baseUrl` in `[site]` is your real address, and `npm run build` prints no `[site]` warning ([SEO & AI Visibility](/covena/customization/seo-ai-visibility/))
- [ ] `title`, `tagline`, `description`, and `logoText` in `[site]`, and `common.tagline` and `common.siteDescription` in each `src/i18n/<lang>.json`, describe your firm ([Site Identity & Logo](/covena/customization/site-identity-logo/))
- [ ] The logo, favicons (`npm run generate-favicons`), the sharing image (`public/images/og-image.jpg`), colors in `theme.css`, and fonts in `fonts.json` are yours ([Colors & Fonts](/covena/customization/colors-fonts/))

**Firm details**

- [ ] `[seo] author` is your firm's name (search engines read it in the structured data), and `[settings.contactInfo]` has your phone and email ([Firm Info](/covena/customization/firm-info/))
- [ ] `contactInfo` in each `src/i18n/<lang>.json` has your address, and the office files in `src/content/offices/` are your offices
- [ ] The regulator line in `src/content/pages/<language>/regulatory-information.md` has your regulator, your number, and a link to its rules. No square-bracket placeholders are left
- [ ] `footer.description` and `footer.copyright` in each `src/i18n/<lang>.json` name your firm, and the links in `src/config/social.json` are your profiles (or `"enable": false`)
- [ ] A project-wide search for `example.com`, `7946`, and `496 0` finds nothing you still need to change. The sample numbers are in UK ranges set aside for TV and film

**Forms**

- [ ] `contactFormAction` and `contactFormProvider` post to your own account, and a test message arrives ([Forms](/covena/customization/forms/))
- [ ] The Mailchimp `formAction` in `[settings.subscription]` and in `src/content/sections/<language>/newsletter.md` is your list, or the forms are turned off
- [ ] The careers inbox (`careers@example.com` in `src/content/careers/<language>/`) is yours, or the sample roles are removed

**Sample content**

- [ ] The attorneys, results, reviews, the 4.9 rating, awards, press mentions, client logos, fees, insights posts, and roles are yours or deleted ([Collections](/covena/customization/collections/), [Results & Reviews](/covena/customization/results-reviews/), [Fees](/covena/customization/fees/))
- [ ] Every result still shows the disclaimer (`results.disclaimer` in `src/i18n/<lang>.json`)
- [ ] The demo photos in `src/assets/images/covena/` are replaced with your own ([Icons & Images](/covena/customization/icons-images/))

**Pages and menus**

- [ ] The privacy policy, terms, disclaimer, and accessibility statement in `src/content/pages/<language>/` are rewritten for your firm and reviewed
- [ ] The homepages you don't use are removed, and the menus point at your pages ([Homepages](/covena/customization/homepages/), [Menus](/covena/customization/menus/))
- [ ] `/components/` is removed or set to `draft: true` if you don't want the component gallery online ([Pages](/covena/customization/pages/))
- [ ] `url` in `[settings.quickExit]` is a neutral page for your country, or the button is turned off ([Quick Exit](/covena/features/quick-exit/))

**Analytics and checks**

- [ ] Analytics tags are in `[head]`, marked with `data-consent`, and the cookie banner text lists the tools you use ([Cookies & Analytics](/covena/customization/cookies-analytics/))
- [ ] `npm run verify` finishes without errors
- [ ] The French and Arabic text has been reviewed by a native speaker, or the languages you don't need are removed ([Internationalization](/covena/customization/internationalization/))
- [ ] You checked the site at phone width and in every language you keep

### Deploy
<Tabs>
  <TabItem label="Netlify">

    <Steps>

    1. Push your project to GitHub, GitLab, or Bitbucket.
    2. In Netlify, choose **Add new site → Import an existing project** and pick the repository.
    3. Netlify reads `netlify.toml`: build command `npm run build`, publish folder `dist`, Node.js 22. Click **Deploy**.

    </Steps>

    The build uses `baseUrl` from `config.toml` unless you add a `SITE_URL` environment variable in the Netlify site settings.

    `netlify.toml` also sets long-term caching for `/_astro/*` and `/images/*`, and sends missing `/fr/...` and `/ar/...` addresses to that language's 404 page. When you add a language, add a block like the `/fr/*` one for it.

    Using Netlify Forms? Set `contactFormProvider = "netlify"` and `contactFormAction = "/"`, turn on form detection under **Forms** in the Netlify dashboard, and deploy again.

  </TabItem>
  <TabItem label="Vercel">

    <Steps>

    1. Push your project to GitHub, GitLab, or Bitbucket.
    2. In Vercel, choose **Add New → Project** and import the repository. Framework preset: **Astro**.
    3. Vercel reads `vercel.json`, which builds with `sh vercel.sh`. Click **Deploy**.

    </Steps>

    `vercel.sh` sets the site address (`SITE_URL`) for each build, and on Vercel it replaces `baseUrl`:

    - Production builds use the `SITE_URL` environment variable if you set one in the Vercel project settings. Otherwise they use your Vercel production domain.
    - Preview builds use `https://staging.<your production domain>`.

    Edit `vercel.sh` if you want something else. `vercel.json` also turns on trailing slashes, redirects `/sitemap.xml` to `/sitemap-index.xml`, and serves the `.md` copies (marked `noindex`) and the `llms` files as text.

  </TabItem>
  <TabItem label="Cloudflare Pages">

    **From git:** in the Cloudflare dashboard, open **Workers & Pages → Create → Pages → Connect to Git**, pick the repository, and set the build command to `npm run build` and the output directory to `dist`.

    The included `wrangler.toml` sets `NODE_VERSION = "22.13.1"` under `[vars]` and the output folder in `pages_build_output_dir`. Cloudflare treats this file as the source of truth for those settings, so change them in the file. Set your address with `baseUrl` in `config.toml`.

    **From your computer:** Covena doesn't install Wrangler (Cloudflare's command-line tool) for you. Add it once, change `name` in `wrangler.toml` (shipped as `covena-astro`) to your project name, then log in, build, and deploy:

    ```bash
    npm install -D wrangler
    npx wrangler login
    npm run build
    npm run deploy:cf
    ```

  </TabItem>
  <TabItem label="Other hosts">

    Run `npm run build` and upload the **contents** of `dist/` to your web server or static host. The included `public/.htaccess` covers Apache.

    Ask your host how to serve `.md` files as `text/markdown` and `llms.txt` as `text/plain`, if you keep `[seo.ai] markdownPages` and `llmsTxt` on. Without that, some browsers download those files instead of showing them.

  </TabItem>
</Tabs>

<Aside type="note" title="Keep public/_headers in your repository">
  `public/_headers` tells Netlify and Cloudflare Pages to serve the `llms.txt`
  files and the `.md` page copies as text, and marks the `.md` copies
  `noindex`. Commit it with the rest of the theme so a git-connected host sees
  it.
</Aside>

<Aside type="note">
  When a host builds from your repository, commit `package-lock.json` and keep
  `dist/`, `.astro/`, and `node_modules/` out of git (the included `.gitignore`
  already does).
</Aside>

### After You Launch
<Steps>

1. Open the live site and click through the main pages on a computer and on a phone, including the mega menu, the mobile menu, and the language switcher.
2. Send a test through the contact form, the consultation form on `/consultation/`, and the callback form on Home 3 (if you keep it), and check that each one arrives.
3. If you keep the quick exit button, press it and check where it lands. Then go back to a page that shows the button, press <kbd>Escape</kbd> twice, and check that it lands in the same place.
4. Submit `https://your-domain/sitemap-index.xml` in [Google Search Console](https://search.google.com/search-console) and [Bing Webmaster Tools](https://www.bing.com/webmasters).
5. Check the homepage and an attorney profile with Google's [Rich Results Test](https://search.google.com/test/rich-results).
6. Share a link in a chat app to check the preview image.

</Steps>

### Updating The Live Site
With a git-connected host, every push to your main branch deploys on its own. Run `npm run build` (or `npm run verify`) first to catch errors before they reach your visitors. To take a new version of the theme, see [Updating The Theme](/covena/beginner/updating-the-theme/).