1- name : doc release
1+ name : Deploy VitePress site to Pages
22
33on :
4+ # Allows you to run this workflow manually from the Actions tab
45 workflow_dispatch :
5- inputs :
6- tag :
7- required : true
8- description : " git tag to release(this input is meaningless)"
6+
7+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
14+ # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
15+ concurrency :
16+ group : pages
17+ cancel-in-progress : false
18+
919jobs :
10- docker :
20+ # Build job
21+ build :
1122 runs-on : ubuntu-latest
1223 steps :
13- - uses : actions/checkout@v3
14- name : Get Code
15-
16- - name : Install Node
17- uses : actions/setup-node@v2
24+ - name : Checkout
25+ uses : actions/checkout@v4
1826 with :
19- node-version : " 16"
20- cache : " yarn"
21- cache-dependency-path : yarn.lock
27+ fetch-depth : 0 # Not needed if lastUpdated is not enabled
28+ # - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
29+ # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
30+ - name : Setup Node
31+ uses : actions/setup-node@v4
32+ with :
33+ node-version : 20
34+ cache : npm # or pnpm / yarn
35+ - name : Setup Pages
36+ uses : actions/configure-pages@v4
2237 - name : Install dependencies
23- run : yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
24- - name : Build Doc
25- run : yarn run docs:build
26- - name : Release Doc
27- uses :
JamesIves/github -pages-[email protected] 38+ run : npm ci # or pnpm install / yarn install / bun install
39+ - name : Build with VitePress
40+ run : npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
41+ - name : Upload artifact
42+ uses : actions/upload -pages-artifact@v3
2843 with :
29- branch : gh-pages # The branch the action should deploy to.
30- folder : docs/.vitepress/dist # The folder the action should deploy.
44+ path : docs/.vitepress/dist
45+
46+ # Deployment job
47+ deploy :
48+ environment :
49+ name : github-pages
50+ url : ${{ steps.deployment.outputs.page_url }}
51+ needs : build
52+ runs-on : ubuntu-latest
53+ name : Deploy
54+ steps :
55+ - name : Deploy to GitHub Pages
56+ id : deployment
57+ uses : actions/deploy-pages@v4
0 commit comments