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 Pages | |
on: | |
push: | |
branches: [main] | |
paths: | |
- 'docs/**' | |
- 'package.json' | |
- 'package-lock.json' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Clean install dependencies | |
run: | | |
rm -rf node_modules package-lock.json | |
npm install | |
- name: Build VitePress site | |
run: npm run docs:build | |
- name: Deploy to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/.vitepress/dist | |
publish_branch: gh-pages | |
force_orphan: true |