-
Notifications
You must be signed in to change notification settings - Fork 838
78 lines (69 loc) · 2.02 KB
/
ci.yml
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
name: ci
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 签出仓库
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: 设置 PNPM
uses: pnpm/action-setup@v3
with:
version: 9
- name: 设置 Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
cache: pnpm
- name: 安装依赖项
run: pnpm install
- name: 构建
run: |
pnpm build
# - name: Deploy
# uses: JamesIves/github-pages-deploy-action@v4
# with:
# branch: gh-pages
# folder: dist
- name: 提交变更项
uses: EndBug/add-and-commit@v9
with:
# default_author: github_actions
add: "src"
message: "Auto Build Preview"
author_name: GitHub Actions
author_email: github-actions[bot]@users.noreply.github.com
send-dispatch:
name: 请求部署上线
if: github.repository == 'zotero-chinese/styles' && github.event_name != 'pull_request'
needs:
- build
runs-on: ubuntu-latest
steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository: zotero-chinese/website
event-type: update-triggered-by-styles-repo
sync:
name: 同步到 Gitee
if: github.repository == 'zotero-chinese/styles' && github.event_name != 'pull_request'
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
source-repo: "[email protected]:zotero-chinese/styles.git" # github仓库地址
destination-repo: "[email protected]:redleafnew00/Chinese-STD-GB-T-7714-related-csl.git" # gitee仓库地址