Deploying to GitHub Pages
This project is preconfigured for easy deployment to GitHub Pages, allowing you to publish your VitePress site directly from your repository.
Automated Deployment with GitHub Actions
A GitHub Actions workflow is already included at .github/workflows/deploy.yml. This workflow automates the process of building and deploying your site to GitHub Pages whenever you trigger it manually from the Actions tab.
Key Features of the Workflow
- Automatic Build: Installs dependencies and builds your VitePress site.
- Artifact Upload: Uploads the generated static files for deployment.
- One-Click Deploy: Deploys the site to GitHub Pages with a single workflow run.
- Safe and Concurrent: Ensures only one deployment runs at a time for consistency.
How to Deploy
- Push your changes to the
mainbranch (or trigger the workflow manually from the Actions tab). - GitHub Actions will run the workflow defined in
.github/workflows/deploy.yml. - Your site will be published to GitHub Pages automatically.
Customizing the Workflow
- The workflow uses Node.js 22 and the latest VitePress version.
- You can switch to
bun,pnpm, oryarnby editing the install and build steps in the workflow file. - The build output is taken from
.vitepress/distby default.
Where to Find the Workflow
- The workflow file is located at:
.github/workflows/deploy.yml - You can view and edit it directly in your repository.
Note: By default, the workflow is set up for manual deployment only. If you want your site to deploy automatically on every push to the
mainbranch, you need to uncomment lines 6-7 in.github/workflows/deploy.yml:yamlpush: branches: [main]This will enable the workflow to run automatically whenever you push changes to
main.
Learn More
With this setup, deploying your VitePress site is fast, reliable, and fully automated!