data-driven event system
1# Sample workflow for building and deploying a VitePress site to GitHub Pages
2#
3name: Deploy VitePress site to Pages
4
5on:
6 # Runs on pushes targeting the `main` branch. Change this to `master` if you're
7 # using the `master` branch as the default branch.
8 push:
9 branches: [documentation]
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
15permissions:
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.
22concurrency:
23 group: pages
24 cancel-in-progress: false
25
26jobs:
27 # Build job
28 build:
29 runs-on: ubuntu-latest
30 steps:
31 - name: Checkout
32 uses: actions/checkout@v4
33 with:
34 fetch-depth: 0 # Not needed if lastUpdated is not enabled
35 # - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm
36 - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
37 - name: Setup Node
38 uses: actions/setup-node@v4
39 with:
40 node-version: 20
41 - name: Setup Pages
42 uses: actions/configure-pages@v4
43 - name: Install dependencies
44 run: bun install # or pnpm install / yarn install / bun install
45 - name: Build with VitePress
46 run: bun run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
47 - name: Upload artifact
48 uses: actions/upload-pages-artifact@v3
49 with:
50 path: docs/.vitepress/dist
51
52 # Deployment job
53 deploy:
54 environment:
55 name: github-pages
56 url: ${{ steps.deployment.outputs.page_url }}
57 needs: build
58 runs-on: ubuntu-latest
59 name: Deploy
60 steps:
61 - name: Deploy to GitHub Pages
62 id: deployment
63 uses: actions/deploy-pages@v4