Merge branch 'main' of https://github.com/redleafnew/Chinese-STD-GB-T… #76
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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仓库地址 |