Skip to content
Type something to search...

Deployment Guide

This 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 publish directory (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 _astro and images folders.

Steps

  1. Create a new site on Netlify.
  2. Connect your Git repository.
  3. Ensure the netlify.toml file is in the root of your project.
  4. Netlify will automatically use the settings from the netlify.toml file 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

  1. Create a new project on Vercel.
  2. Connect your Git repository.
  3. Ensure the vercel.json and vercel.sh files are in the root of your project.
  4. The vercel.json file contains important configurations, like setting the trailing slash behavior and defining redirects (e.g., /sitemap.xml to /sitemap-index.xml).
  5. The vercel.sh script 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.js theme easily, though the configuration is slightly different from Netlify and Vercel. Here’s how you can deploy:

Steps

  1. First add following code in astro.config.mjs file
  2. Create a new project on Cloudflare Pages.
  3. Connect your Git repository.
  4. Ensure that the build settings are configured to build your site with yarn build and output to the dist directory.
  5. Cloudflare Pages should automatically pick up your site configuration, but you may need to set the environment to Node.js 22 for compatibility.