1- name : Publish docs via GitHub Pages
1+ name : Deploy VitePress site to Pages
2+
23on :
4+ # Runs on pushes targeting the `main` branch. Change this to `master` if you're
5+ # using the `master` branch as the default branch.
36 push :
4- branches :
5- - main
7+ branches : [main]
8+ pull_request :
9+ types : [ assigned, opened, synchronize, reopened ]
10+ # Allows you to run this workflow manually from the Actions tab
11+ workflow_dispatch :
12+
13+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
614permissions :
7- contents : write
15+ contents : read
16+ pages : write
17+ id-token : write
18+
19+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
20+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
21+ concurrency :
22+ group : pages
23+ cancel-in-progress : false
824
925jobs :
10- deploy :
11- name : Deploy docs
26+ # Build job
27+ build :
1228 runs-on : ubuntu-latest
1329 steps :
14- - name : Checkout main
30+ - name : Checkout
1531 uses : actions/checkout@v4
16- - name : Configure Git Credentials
17- run : |
18- git config user.name github-actions[bot]
19- git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20- - uses : actions/setup-python@v5
2132 with :
22- python-version : 3.x
23- - run : echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
24- - uses : actions/cache@v4
33+ fetch-depth : 0 # Not needed if lastUpdated is not enabled
34+ # - uses: pnpm/action-setup@v3 # Uncomment this block if you're using pnpm
35+ # with:
36+ # version: 9 # Not needed if you've set "packageManager" in package.json
37+ # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
38+ - name : Setup Node
39+ uses : actions/setup-node@v4
40+ with :
41+ node-version : 24
42+ cache : npm # or pnpm / yarn
43+ - name : Setup Pages
44+ uses : actions/configure-pages@v5
45+ - name : Install dependencies
46+ run : npm ci # or pnpm install / yarn install / bun install
47+ - name : Build with VitePress
48+ run : npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
49+ - name : Upload artifact
50+ uses : actions/upload-pages-artifact@v3
2551 with :
26- key : mkdocs-material-${{ env.cache_id }}
27- path : .cache
28- restore-keys : |
29- mkdocs-material-
30- - run : pip install mkdocs-material mkdocs-multirepo-plugin
31- - name : Deploy docs
32- run : mkdocs gh-deploy --force
33- env :
34- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52+ path : docs/.vitepress/dist
53+ if : github.event_name != 'pull_request' # Skip upload on PRs
54+
55+ # Deployment job
56+ deploy :
57+ if : github.event_name != 'pull_request' # Skip deployment on PRs
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