Deploy VitePress site to Pages #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy VitePress site to GitHub Pages | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout repository | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# 2. Setup Node.js | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "npm" | |
# 3. Install dependencies | |
- name: Install dependencies | |
run: npm install | |
# 4. Build VitePress site | |
- name: Build VitePress site | |
run: npm run docs:build | |
# 5. Deploy to GitHub Pages | |
- name: Deploy to GitHub Pages | |
uses: actions/deploy-pages@v4 | |
with: | |
path: docs/.vitepress/dist |