DEV Community

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

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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay