Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/content/docs/en/guides/deploy/github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: How to deploy your Astro site to the web using GitHub Pages.
type: deploy
i18nReady: true
---
import { Steps } from '@astrojs/starlight/components';

You can use [GitHub Pages](https://pages.github.com/) to host an Astro website directly from a repository on [GitHub.com](https://github.com/).

Expand Down Expand Up @@ -35,7 +36,6 @@ The value for `site` must be one of the following:
- The following URL based on your username: `https://<username>.github.io`
- The random URL autogenerated for a [GitHub Organization's private page](https://docs.github.com/en/enterprise-cloud@latest/pages/getting-started-with-github-pages/changing-the-visibility-of-your-github-pages-site): `https://<random-string>.pages.github.io/`


#### `base`

A value for `base` may be required so that Astro will treat your repository name (e.g. `/my-repo`) as the root of your website.
Expand Down Expand Up @@ -83,6 +83,7 @@ export default defineConfig({

## Configure a GitHub Action

<Steps>
1. Create a new file in your project at `.github/workflows/deploy.yml` and paste in the YAML below.

```yaml title="deploy.yml"
Expand Down Expand Up @@ -140,6 +141,6 @@ export default defineConfig({
3. Choose **GitHub Actions** as the **Source** of your site.

4. Commit the new workflow file and push it to GitHub.

</Steps>

Your site should now be published! When you push changes to your Astro project’s repository, the GitHub Action will automatically deploy them for you.