-
Notifications
You must be signed in to change notification settings - Fork 524
54 lines (46 loc) · 1.36 KB
/
main.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
name: Auto update translator metadata
on:
push:
branches:
- master
- test
paths:
- '*.js'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
# copy git 仓库到虚拟机上
- name: 'Checkout codes'
uses: actions/checkout@v3
with:
fetch-depth: 0
# fix fatal: ambiguous argument 'HEAD~1': unknown revision or path not in the working tree.
- run: git checkout master
- name: Install Node
uses: actions/setup-node@v2
with:
node-version: 17
# Local via act
- name: Install packages for act
if: env.ACT == 'true'
run: apt update && apt install -y xvfb git rsync
- name: Install node packages
run: npm ci
- name: Update metadata
run: |
node data/updateJSON.js
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions Bot
author_email: [email protected]
message: 'commit and push JSON files.'
- name: mirror
uses: wearerequired/git-mirror-action@master #开源actions包
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
with:
source-repo: "[email protected]:l0o0/translators_CN.git" # github仓库地址
destination-repo: "[email protected]:goonback/translators_CN.git" # gitee仓库地址