Deploy
SwiftAgency builds to plain static files in dist/. Any host that serves HTML works; the theme ships ready-made configuration for the three most common ones.
Before you deploy
Section titled “Before you deploy”-
Set
urlinsrc/config/site.tsto your domain. Canonical URLs, the sitemap,hreflanglinks and social cards are built from it. -
Change the
Sitemap:line inpublic/robots.txtto the same domain. -
Run
npm run verifylocally. If it passes, the build will pass on your host too. -
Push the project to your own GitHub, GitLab or Bitbucket repository.
Pick a host
Section titled “Pick a host”Import the repository in Netlify. netlify.toml sets everything:
- build command
npm run build, publish directorydist - Node 22, and
KEYSTATIC=falseso the CMS never loads during a build - pretty URLs, so
/workis served fromwork.html
Cache and security headers come from public/_headers.
Import the repository in Vercel. It detects Astro, and vercel.json adds:
- clean URLs without trailing slashes
- a year-long cache for hashed files in
/_astro/ - security headers:
nosniff, a strict referrer policy, frame blocking and a permissions policy
wrangler.jsonc serves dist/ with Workers static assets, drops trailing slashes and uses the theme’s 404.html.
npm run buildnpx wrangler deployOr connect the repository in the Cloudflare dashboard with build command npm run build. Change name in wrangler.jsonc first; it becomes part of your workers.dev address. Headers come from public/_headers.
Run npm run build and upload the contents of dist/. Configure the server to:
- serve
/workfromwork.html(the build usesbuild.format: 'file') - answer unknown URLs with
404.htmland status 404 - cache
/_astro/*for a year; those file names change whenever their content does
One-click deploy buttons
Section titled “One-click deploy buttons”The theme’s README has “Deploy to Netlify”, “Deploy with Vercel” and “Deploy to Cloudflare” buttons. They copy a repository into your account and deploy it in one go. They point at the theme’s own repository, so once your project lives in your repository, replace ilesscodex/SwiftAgency in the button links with yours.
Custom domain and HTTPS
Section titled “Custom domain and HTTPS”All three hosts issue certificates automatically once you add a domain in their dashboard. Update url in site.ts to the final domain and redeploy, otherwise canonical links keep pointing at the old address.
Continuous integration
Section titled “Continuous integration”.github/workflows/ci.yml runs on every push and pull request:
npm ciandnpm run verify: Astro Check, ESLint, Prettier and a full build.- Lighthouse CI on seven key pages, three runs each. The job fails if Accessibility, Best Practices or SEO drop below 100, or desktop Performance below 95.
Hosts build on their own, so CI is a safety net rather than a deploy step. See Performance.