-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsync2gitee.list.yml
55 lines (48 loc) · 1.83 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
name: sync2gitee(list)
# version: 1。1.0
# 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-02-02 10:23:02
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/[email protected]
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/[email protected]
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]
- 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 }}
static_list: '${{ steps.repo.outputs.repoList }}'
cache_path: /github/workspace/hub-mirror-cache
account_type: user
force_update: true
- name: Print cache path
run: |
ls -la ${{ github.workspace }}/hub-mirror-cache