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
28 changes: 1 addition & 27 deletions src/content/docs/en/guides/deploy/github.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar:
type: deploy
i18nReady: true
---
import { Steps, FileTree } from '@astrojs/starlight/components';
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 All @@ -18,32 +18,6 @@ Astro maintains the official `withastro/action` to deploy your project with very

## Configure Astro for GitHub Pages

You can deploy your Astro site on GitHub Pages with a few configuration steps to ensure that your project can be processed and built successfully.

### Preparing your Astro project for GitHub Pages

By default, GitHub Pages applies Jekyll static site processing, which can interfere with files and folders that begin with an underscore such as Astro's `_astro/` directory.

To prevent this Jekyll processing, add an empty `.nojekyll` file to your Astro project's `public/` directory. Astro will automatically copy this file into the final `dist/` folder during the build process. This disables Jekyll on GitHub Pages and ensures that your Astro project files are correctly served.

The following example shows this file added to a minimal Astro project:

<FileTree>

- public/
- **.nojekyll**
- favicon.svg
- src/
- pages/
- index.astro
- styles/
- global.css
- astro.config.mjs
- package.json
- tsconfig.json

</FileTree>

### Deploying to a `github.io` URL

Set the [`site`](/en/reference/configuration-reference/#site) and [`base`](/en/reference/configuration-reference/#base) options in `astro.config.mjs`.
Expand Down