Deployment Guide
Each of our theme is compatible with Netlify, Vercel, and Cloudflare Pages. Below, you will find configuration details for each platform to ensure a smooth deployment process.
Learn more in official documentation.
Netlify Deployment
To deploy your project on Netlify, simply use the provided netlify.toml file. This file defines the build settings and cache headers. Here’s what the file does:
- Build Settings: Specifies the
publishdirectory (dist) and the build command (yarn build). - Node Version: Sets Node.js version 22 for compatibility.
- Cache-Control Headers: Ensures optimal caching for assets in the
_astroandimagesfolders.
Steps
- Create a new site on Netlify.
- Connect your Git repository.
- Ensure the
netlify.tomlfile is in the root of your project. - Netlify will automatically use the settings from the
netlify.tomlfile to build and deploy your site.
Vercel Deployment
For Vercel, you can use the provided vercel.json file along with a custom build script (vercel.sh). This script ensures that the correct base URL is used for production and preview environments.
Steps
- Create a new project on Vercel.
- Connect your Git repository.
- Ensure the
vercel.jsonandvercel.shfiles are in the root of your project. - The
vercel.jsonfile contains important configurations, like setting the trailing slash behavior and defining redirects (e.g.,/sitemap.xmlto/sitemap-index.xml). - The
vercel.shscript automatically detects whether the deployment is for production or preview and sets the base URL accordingly before running the build.
Cloudflare Pages Deployment
Cloudflare Pages supports deploying your Astro theme easily, though the configuration is slightly different from Netlify and Vercel. Here’s how you can deploy:
Steps
- Create a new project on Cloudflare Pages.
- Connect your Git repository.
- Ensure that the build settings are configured to build your site with
yarn buildand output to thedistdirectory. - Cloudflare Pages should automatically pick up your site configuration, but you may need to set the environment to Node.js 22 for compatibility.
Didn’t find your favorite platform? Checkout Official Docs.