Skip to content

Commit 1335015

Browse files
committed
workflow
1 parent a383328 commit 1335015

File tree

4 files changed

+66
-3
lines changed

4 files changed

+66
-3
lines changed

.github/workflows/gh-pages.yaml

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

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
**/.vitepress/cache/**
22
node_modules/**
3+
**/dist/**

_config.yml

Whitespace-only changes.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"scripts": {
3-
"docs:dev": "vitepress dev home",
4-
"docs:build": "vitepress build home",
5-
"docs:preview": "vitepress preview home"
3+
"home:dev": "vitepress dev home",
4+
"home:build": "vitepress build home",
5+
"home:preview": "vitepress preview home"
66
},
77
"dependencies": {
88
"vitepress": "^1.5.0",

0 commit comments

Comments
 (0)