Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 1.76 KB

heroku.mdx

File metadata and controls

62 lines (45 loc) · 1.76 KB
title description type i18nReady
Deploy your Astro Site to Heroku
How to deploy your Astro site to the web using Heroku.
deploy
true

import { Steps } from '@astrojs/starlight/components';

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.

:::danger The following instructions use the deprecated heroku-static-buildpack. Please see Heroku's documentation for using heroku-buildpack-nginx instead. :::

How to deploy

1. Install the [Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli).
  1. Create a Heroku account by signing up.

  2. Run heroku login and fill in your Heroku credentials:

    $ heroku login
  3. Create a file called static.json in the root of your project with the below content:

    {
      "root": "./dist"
    }

    This is the configuration of your site; read more at heroku-buildpack-static.

  4. Set up your Heroku git remote:

    # 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
  5. Deploy your site:

    # publish site
    $ git push heroku master
    
    # opens a browser to view the Dashboard version of Heroku CI
    $ heroku open