Skip to content

Commit 397d05b

Browse files
author
sky.sun
committed
cicd
1 parent d0bc1cd commit 397d05b

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy VitePress site to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 18
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v2
23+
with:
24+
version: 9
25+
26+
- name: Install dependencies
27+
run: pnpm install
28+
29+
- name: Build site
30+
run: pnpm run build
31+
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v4
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./docs/.vitepress/dist

docs/.vitepress/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,5 @@ export default defineConfig({
174174
provider: 'local'
175175
},
176176
},
177+
base: '/LearnPython4Fe/'
177178
})

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"scripts": {
77
"dev": "vitepress dev docs",
88
"build": "vitepress build docs",
9-
"preview": "vitepress preview docs"
9+
"preview": "vitepress preview docs",
10+
"deploy": "sh ./scripts/deploy.sh"
1011
},
1112
"author": "eshengsky",
1213
"license": "MIT",

0 commit comments

Comments
 (0)