-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.11 KB
/
deploy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: VitePress在部署静态网站
on:
# 推送到主分支时触发更新网站部署的工作流。
push: {branches: [main]}
workflow_dispatch:
# 给必要的权限。
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
# 编译构造步骤。
build:
runs-on: ubuntu-latest
steps:
# 提供所支持的环境。
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/configure-pages@v4
# 运行npm脚本安装依赖并检查,而后编译为静态网页。
- run: npm install
- run: npm run check
- run: npm run build
# 编译完成后将指定目录部署到 GitHub Pages。
- uses: actions/upload-pages-artifact@v3
with: {path: docs/.vitepress/dist}
# 部署步骤。
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: deploy
steps:
- name: deploy to github pages
id: deployment
uses: actions/deploy-pages@v4