DEV Community

Cover image for An easier way to deploy AstroJS on GitHub Pages
Dylan Zhang
Dylan Zhang

Posted on

An easier way to deploy AstroJS on GitHub Pages

It may be a little confusing when you follow the AstroJS official guide to deploy your blog on GitHub. Don't worry, I found an easier way. Follow these steps:

  • Choose a theme.

I like the Dante theme

  • Rename the repository to {username}.github.io

As I did with zwd321081.github.io.This is crucial because Github pages has specific naming rules

  • Go to the Actions tab and search for the Astro workflow

astro workflow

  • Making some modification to astro.yml

Remove the --site and --base options. This will result in your default URL being structured as https://{username}.github.io/{reponame}.
By removing these options, you eliminate the subpage path.

config

  • Visit your page at the domain https://{username}.github.io, such as mine.

Top comments (0)