1+ # Sample workflow for building and deploying a VitePress site to GitHub Pages
2+ # https://vitepress.dev/guide/deploy#github-pages
3+ #
4+ name : Deploy VitePress site to Pages
5+
6+ on :
7+ # Runs on pushes targeting the `main` branch. Change this to `master` if you're
8+ # using the `master` branch as the default branch.
9+ push :
10+ branches : [main]
11+
12+ # Allows you to run this workflow manually from the Actions tab
13+ workflow_dispatch :
14+
15+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+ permissions :
17+ contents : read
18+ pages : write
19+ id-token : write
20+
21+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+ concurrency :
24+ group : pages
25+ cancel-in-progress : false
26+
27+ jobs :
28+ # Build job
29+ build :
30+ runs-on : ubuntu-latest
31+ steps :
32+ - name : Checkout
33+ uses : actions/checkout@v4
34+ with :
35+ fetch-depth : 0 # Not needed if lastUpdated is not enabled
36+ # - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
37+ # with:
38+ # version: 9 # Not needed if you've set "packageManager" in package.json
39+ # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
40+ - name : Setup Node
41+ uses : actions/setup-node@v4
42+ with :
43+ node-version : 22
44+ cache : npm # or pnpm / yarn
45+ - name : Setup Pages
46+ uses : actions/configure-pages@v4
47+ - name : Install dependencies
48+ run : npm ci # or pnpm install / yarn install / bun install
49+ - name : Build with VitePress
50+ run : npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
51+ - name : Upload artifact
52+ uses : actions/upload-pages-artifact@v3
53+ with :
54+ path : docs/.vitepress/dist
55+
56+ # Deployment job
57+ deploy :
58+ environment :
59+ name : github-pages
60+ url : ${{ steps.deployment.outputs.page_url }}
61+ needs : build
62+ runs-on : ubuntu-latest
63+ name : Deploy
64+ steps :
65+ - name : Deploy to GitHub Pages
66+ id : deployment
67+ uses : actions/deploy-pages@v4
0 commit comments