Build with Astro
Create an Astro site from an Azion template, a GitHub repository, or the Azion CLI, and deploy it to an Azion domain.
You can deploy an Astro site on Azion from a template in Azion Console, from your GitHub repository, or with the Azion CLI. Every route ends with the site running on Azion and answering on an Azion domain.
Azion runs an Astro site as a static application. The build writes the site to ./dist, and the deploy uploads that folder to a storage bucket that an application serves. For the other frameworks Azion builds, refer to Frameworks compatibility.
Prerequisites
Console
- An Azion account. To create one, refer to Create an account.
- Access to Azion Console. To sign in, refer to How to access Azion Console.
- A GitHub account. A template deploy connects it when the form asks for it.
Astro templates
A template is a ready Astro project that Azion deploys for you. The Console route starts from one of these templates:
| Template | Use |
|---|---|
| Astro Audiophile | E-commerce |
| Astro Boilerplate | Starter project |
| Astro Blog Starter Kit | Blog creation |
| Astro Ecommerce | E-commerce platform |
| Astro with Multiple Frameworks | Starter project |
| Astro with Framework Preact | Starter project |
| Astro Minimal | Starter project |
| Astro with Non-HTML Pages | Non-HTML content |
| Astro Portfolio | Portfolio website |
| Astro Quickstore | E-commerce |
| Astro Starlog | Project release notes |
| Astro with Markdoc | Starter project |
| Astro Markdown with Plugins | Starter project |
| Astro Markdown with Shiki | Code demo |
| Astro with MDX | Starter project |
| Astro with Nano Stores | E-commerce |
| Astro with Tailwind CSS | Tailwind integration |
| Astro with Vitest | Starter project |
| Cosmic - Simple Astro Blog | Blog |
| Devscard | Developer portfolio |
| Clean Astro App with Sanity | CMS integration |
| Webpage to PDF Resume | Resume generator |
Two templates have a guide of their own, linked in the table. For more information on the others, refer to Azion Marketplace. In the CLI route, azion init lists the templates of the Astro preset in its own picker.
Deploy the site
Each route builds the Astro project and creates the resources that serve it on Azion. Follow the panel of the route you selected:
Console
To deploy an Astro template from Azion Console:
Access Azion Console > Create > Templates.
In Search by name, framework, or keyword, enter Astro.
If the form shows GitHub Connection, select Connect with GitHub and install the Azion GitHub App.
In Git Scope, select the scope for the template.
The deploy page opens and shows the Deploy Log while the project builds. When the deploy succeeds, Successfully created! appears, and the page shows the domain URL and a Manage button that opens the application.
In the Build and run marketing websites use case, this section takes these values:
| Setting | Value |
|---|---|
| Project | example-site, created with azion init and the Astro preset |
| Configuration file | azion.config.mjs, which the first azion build generates with the bucket, the cache setting, and the rules of the site |
Check the site
The deploy returns the URL of the site’s Azion domain, in the form https://xxxxxxxxxx.map.azionedge.net. Azion Console shows it on the deploy page, and azion deploy prints it when it ends. Open the URL in a browser to see the Astro site.
The first deploy can take several minutes to answer from every location; later deploys take about two minutes. Until a location receives the site, the domain answers with a 404 page that reads There's nothing here yet. On that response, wait and request the URL again.
These checks confirm the Build and run marketing websites use case.