-
Notifications
You must be signed in to change notification settings - Fork 7
59 lines (52 loc) · 1.95 KB
/
sync2gitee.list.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
name: sync2gitee(list)
# version: 1.0.4
# author: [yiXu](https://github.com/yi-Xu-0100)
# guide: [yi-Xu-0100/hub-mirror](https://github.com/yi-Xu-0100/hub-mirror)
# template: [sync2gitee.list.yml](https://github.com/yi-Xu-0100/hub-mirror/blob/main/template/sync2gitee.list.yml)
# lastmod: 2021-01-29 23:06:10
on:
workflow_dispatch:
schedule:
# UTC 17:30 -> CST (China) 1:30 see https://datetime360.com/cn/utc-cst-china-time/
- cron: '30 17 * * *'
jobs:
run:
name: Sync GitHub to Gitee(list)
runs-on: ubuntu-latest
steps:
- name: Get repo and time
id: info
uses: actions/github-script@v6
with:
result-encoding: string
script: |
core.setOutput('time', new Date(Date.now()).toISOString().replace(/[^0-9]/g, ""));
core.setOutput('key', `${context.repo.owner}-${context.repo.repo}`);
- name: Cache src repos
uses: actions/cache@v3
id: cache
with:
path: ${{ github.workspace }}/hub-mirror-cache
key: ${{ runner.os }}-${{ steps.info.outputs.key }}-list-cache-${{ steps.info.outputs.time }}
restore-keys: ${{ runner.os }}-${{ steps.info.outputs.key }}-list-
- name: Generate repo list
id: repo
uses: yi-Xu-0100/[email protected]
with:
allow_archived: false
- name: Mirror hub with cache and list
uses: Yikun/[email protected]
with:
src: github/yi-Xu-0100
dst: gitee/yiXu0100
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
black_list: '${{ steps.repo.outputs.repo }},cfw-scripts'
static_list: '${{ steps.repo.outputs.repoList }}'
cache_path: /github/workspace/hub-mirror-cache
account_type: user
force_update: true
timeout: 10m
- name: Print cache path
run: |
ls -la ${{ github.workspace }}/hub-mirror-cache