-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (53 loc) · 1.72 KB
/
sync-docs.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Sync Docs
on:
repository_dispatch:
types:
- sync
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 检查分支
uses: actions/checkout@master
- name: 安装node环境
uses: actions/setup-node@master
with:
node-version: "18.x"
- name: Setup pnpm
uses: pnpm/action-setup@v3 # docs https://pnpm.io/continuous-integration#github-actions
with:
version: 9 # Optional: specify a pnpm version
- name: 安装依赖
run: |
export TZ='Asia/Shanghai'
pnpm install
- name: 拉取文档
env:
YUQUE_USERNAME: ${{ secrets.YUQUE_USERNAME }}
YUQUE_PASSWORD: ${{ secrets.YUQUE_PASSWORD }}
YUQUE_LOGIN: ${{ secrets.YUQUE_LOGIN }}
YUQUE_REPO: ${{ secrets.YUQUE_REPO }}
R2_ACCESSKEYID: ${{secrets.R2_ACCESSKEYID}}
R2_SECRET_ACCESSKEY: ${{secrets.R2_SECRET_ACCESSKEY}}
R2_BUCKET: ${{secrets.R2_BUCKET}}
R2_ENDPOINT: ${{secrets.R2_ENDPOINT}}
R2_HOST: ${{secrets.R2_HOST}}
run: |
pnpm sync-s
# npm run elog:sync-short
- name: 配置Git用户名邮箱
run: |
git config --global user.name "white0dew"
git config --global user.email ${{ secrets.Email_Github }}
- name: 提交拉取的文档到GitHub仓库
run: |
git add .
git commit -m "更新文档" -a
- name: 推送文档到仓库
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
event-type: deploy