Skip to content

Commit 28d2711

Browse files
committed
docs: support github pages
1 parent d5d9a5c commit 28d2711

File tree

3 files changed

+65
-2
lines changed

3 files changed

+65
-2
lines changed

.github/workflows/deploy.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# 构建 VitePress 站点并将其部署到 GitHub Pages 的示例工作流程
2+
name: Deploy VitePress site to Pages
3+
4+
on:
5+
# 在针对 `main` 分支的推送上运行。如果你
6+
# 使用 `master` 分支作为默认分支,请将其更改为 `master`
7+
push:
8+
branches: [main]
9+
10+
# 允许你从 Actions 选项卡手动运行此工作流程
11+
workflow_dispatch:
12+
13+
# 设置 GITHUB_TOKEN 的权限,以允许部署到 GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# 只允许同时进行一次部署,跳过正在运行和最新队列之间的运行队列
20+
# 但是,不要取消正在进行的运行,因为我们希望允许这些生产部署完成
21+
concurrency:
22+
group: pages
23+
cancel-in-progress: false
24+
25+
jobs:
26+
# 构建工作
27+
build:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
with:
33+
fetch-depth: 0 # 如果未启用 lastUpdated,则不需要
34+
# - uses: pnpm/action-setup@v3 # 如果使用 pnpm,请取消注释
35+
# - uses: oven-sh/setup-bun@v1 # 如果使用 Bun,请取消注释
36+
- name: Setup Node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: 20
40+
cache: npm # 或 pnpm / yarn
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
- name: Install dependencies
44+
run: npm ci # 或 pnpm install / yarn install / bun install
45+
- name: Build with VitePress
46+
run: npm run docs:build # 或 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+
# 部署工作
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

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# 系统设计面试:内幕指南
22

3-
>《System Design Interview: An Insider’s Guide》 - 中文版
3+
>《System Design Interview: An Insider’s Guide》 - 中文翻译
44
55
<img src="./docs/public/cover.png" width="400" />
66

docs/.vitepress/config.mts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from 'vitepress'
33
// https://vitepress.dev/reference/site-config
44
export default defineConfig({
55
title: "系统设计面试:内幕指南",
6-
description: "《System Design Interview: An Insider’s Guide》 中文版",
6+
description: "《System Design Interview: An Insider’s Guide》 中文翻译",
77
themeConfig: {
88
// https://vitepress.dev/reference/default-theme-config
99

0 commit comments

Comments
 (0)