Deploy your Astro Site to Heroku
Heroku is a platform-as-a-service for building, running, and managing modern apps in the cloud. You can deploy an Astro site to Heroku using this guide.
The following instructions use the deprecated heroku-static-buildpack. Please see Heroku’s documentation for using heroku-buildpack-nginx instead.
How to deploy
Section titled How to deploy- 
Install the Heroku CLI. 
- 
Create a Heroku account by signing up. 
- 
Run heroku loginand fill in your Heroku credentials:Terminal window $ heroku login
- 
Create a file called static.jsonin the root of your project with the below content:static.json {"root": "./dist"}This is the configuration of your site; read more at heroku-buildpack-static. 
- 
Set up your Heroku git remote: Terminal window # version change$ git init$ git add .$ git commit -m "My site ready for deployment."# creates a new app with a specified name$ heroku apps:create example# set buildpack for static sites$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-static.git
- 
Deploy your site: Terminal window # publish site$ git push heroku master# opens a browser to view the Dashboard version of Heroku CI$ heroku open