1- # GitHub Actions workflow to build and deploy VitePress docs to GitHub Pages
2- name : Deploy VitePress Docs to GitHub Pages
1+ name : Deploy VitePress site to GitHub Pages
32
43on :
5- # Runs on pushes targeting the default branch
64 push :
7- branches :
8- - main # Change this to 'master' if your default branch is 'master'
9- paths :
10- - ' docs/**' # Only run when docs folder changes
11- - ' .github/workflows/deploy-docs.yml' # Or when this workflow changes
12-
13- # Allows you to run this workflow manually from the Actions tab
5+ branches : [ main ] # or your default branch
146 workflow_dispatch :
157
16- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
178permissions :
189 contents : read
1910 pages : write
2011 id-token : write
2112
22- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
23- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2413concurrency :
25- group : pages
26- cancel-in-progress : false
14+ group : " pages"
15+ cancel-in-progress : true
2716
2817jobs :
29- # Build job
3018 build :
3119 runs-on : ubuntu-latest
3220 steps :
3321 - name : Checkout
3422 uses : actions/checkout@v4
35- with :
36- fetch-depth : 0 # Not needed if lastUpdated is not enabled
3723
38- - name : Setup Node.js
24+ - name : Setup Node
3925 uses : actions/setup-node@v4
4026 with :
4127 node-version : 20
4228 cache : npm
4329
44- - name : Setup Pages
45- uses : actions/configure-pages@v4
46-
47- - name : Install dependencies
30+ - name : Install deps
4831 run : npm ci
4932
50- - name : Build VitePress docs
33+ - name : Build VitePress site
5134 run : npm run docs:build
5235
5336 - name : Upload artifact
5437 uses : actions/upload-pages-artifact@v3
5538 with :
5639 path : docs/.vitepress/dist
5740
58- # Deployment job
5941 deploy :
42+ needs : build
43+ runs-on : ubuntu-latest
6044 environment :
6145 name : github-pages
6246 url : ${{ steps.deployment.outputs.page_url }}
63- needs : build
64- runs-on : ubuntu-latest
65- name : Deploy
6647 steps :
6748 - name : Deploy to GitHub Pages
6849 id : deployment
69- uses : actions/deploy-pages@v4
50+ uses : actions/deploy-pages@v4
0 commit comments