Skip to content

Commit 99b67a4

Browse files
committed
add deploy gh-pages ci
Signed-off-by: frezes <zhangjunhao@kubesphere.io>
1 parent bd7a76f commit 99b67a4

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Deploy Docusaurus Website
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Build Docusaurus
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
working-directory: website # 设置默认工作目录
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Build website
30+
run: npm run build
31+
32+
- name: Upload Build Artifact
33+
uses: actions/upload-pages-artifact@v3
34+
with:
35+
path: build # 相对工作目录 website/build
36+
37+
deploy:
38+
name: Deploy to GitHub Pages
39+
needs: build
40+
permissions:
41+
pages: write
42+
id-token: write
43+
environment:
44+
name: github-pages
45+
url: ${{ steps.deployment.outputs.page_url }}
46+
47+
runs-on: ubuntu-latest
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)