Astro Production Deployment



This is a tutorial to deploy Astro static web app to Azure.

Setup Astro repo

Please follow the Astro Installation guide with GitHub repo enabled

Setup Domain name

You can buy any domain with cheap price from Godaddy.

Deploy your Astro repository to Production

After setting up your Astro repository on GitHub, you are ready to the repository to Production There are several ways to deploy Astro. I only mention two ways, which are Netlify and Azure.

Deploy to Netlify

Astro already has integration to deploy static web app to Netlify. Here is the deployment guide

Add custom domain name in Netlify

Netlify provides default domain name with site-name.netlify.app If you want to add your custom domain, you follow these steps.

  1. Go to Netlify
  2. Open Domain Management tab
  3. Click Add Custom Domain
  4. Enter your custom domain, click Verify

Deploy to Azure

Here are steps to deploy to Azure.

  1. Go to Azure Portal
  2. Click App Services
  3. Click Create
  4. Under Publish, choose Static Web App
  5. Enter Name
  6. Under Deployment Details, choose GitHub
  7. For Hosting Plan, choose Free: For hobby or personal projects
  8. Link your Organization , Repository and Branch
  9. Then click Create

deploy to azure

It will create a deployment .yml file under .github/workflows

Then navigate to Actions in your GitHub repo. Once the workflow runs successfully, you can check your blog is published publicly to the Internet.