Skip to content

Commit c9eb924

Browse files
authored
Create gh-pages.yml
0 parents  commit c9eb924

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/gh-pages.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: github pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main # default branch
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
with:
24+
# 如果配置 themeConfig.lastUpdated 为 false,则不需要添加该参数以加快检出速度
25+
fetch-depth: 0
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: "20"
30+
cache: ${{ steps.detect-package-manager.outputs.manager }}
31+
- name: Install dependencies
32+
run: yarn
33+
- name: Build with dumi
34+
# 文档编译命令,如果是 react 模板需要修改为 npm run docs:build
35+
run: yarn build
36+
- name: Upload artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: ./dist
40+
41+
deploy:
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
45+
runs-on: ubuntu-latest
46+
needs: build
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)