forked from ClassIsland/classisland-docs-next
-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (72 loc) · 2.44 KB
/
deploy-docs.yml
File metadata and controls
83 lines (72 loc) · 2.44 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: 部署文档
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build:
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
concurrency:
group: "web-deploy"
cancel-in-progress: false
environment:
name: classisland-web
name: "Build & Deploy"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# 如果你文档需要 Git 子模块,取消注释下一行
# submodules: true
- name: 设置 pnpm
uses: pnpm/action-setup@v4
with:
version: 9.9.0+sha512.60c18acd138bff695d339be6ad13f7e936eea6745660d4cc4a776d5247c540d0edee1a563695c183a66eb917ef88f2b4feb1fc25f32a7adcadc7aaf3438e99c1
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: 安装依赖
run: |
corepack prepare pnpm@9.9.0 --activate
pnpm install --frozen-lockfile
- name: 构建文档
env:
NODE_OPTIONS: --max_old_space_size=8192
run: |-
pnpm run docs:build
- name: Deploy
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_WEB_PRIVATEKEY }}
# 复制操作的参数。"-avzr --delete"意味部署时清空服务器目标目录下的文件
ARGS: "-avz --delete --no-times --no-perms"
# 源目录
SOURCE: "./src/.vuepress/dist/"
# 部署目标主机
REMOTE_HOST: ${{ secrets.DEPLOY_WEB_IP }}
# 部署目标主机端口
REMOTE_PORT: ${{ secrets.DEPLOY_WEB_PORT }}
# 登录用户
REMOTE_USER: ${{ secrets.DEPLOY_WEB_USERNAME }}
# 部署目标目录
TARGET: ${{ secrets.DEPLOY_WEB_TARGET }}
- name: 提交 IndexNow
uses: bojieyang/indexnow-action@v1
with:
sitemap-location: "https://docs.classisland.tech/sitemap.xml" # change it
endpoint: "www.bing.com"
since: 1
# minite, hour, day, week, month, year
since-unit: "day"
limit: 100
key: ${{ secrets.INDEXNOW_KEY }}
key-location: ${{ secrets.INDEXNOW_KEY_LOCATION }}