Skip to content

Commit 0eef3a1

Browse files
committed
docs: Update deploy workflow for VitePress and Pages deployment
1 parent b04f070 commit 0eef3a1

File tree

1 file changed

+56
-23
lines changed

1 file changed

+56
-23
lines changed

.github/workflows/deploy.yml

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

0 commit comments

Comments
 (0)