-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 2.08 KB
/
sync-mirror.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
# 同步仓库镜像 From: Github Repository
# Path: .github/workflows/sync-mirror.yml
# 需配置环境变量: REMOTE: 远程仓库地址, 例如: [email protected]:hjmcloud/hjm-certcheck.git
# 使用到的action: actions/checkout@v3, yesolutions/[email protected]
# actions/checkout@v3: https://github.com/marketplace/actions/checkout
# yesolutions/[email protected]: https://github.com/marketplace/actions/mirror-repository
name: Sync Mirror
on:
push:
tags:
- v*
env:
TZ: Asia/Shanghai
REMOTE: [email protected]:hjmcloud/config-deliver.git # 这里配置git仓库地址
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# 任务名称 RepoMirror
RepoMirro:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# 这里要把检出深度设置为0,否则会报错
- uses: actions/checkout@v3
with:
fetch-depth: 0
# 同步仓库镜像
- name: mirror-repository
# You may pin to the exact commit or the version.
# uses: yesolutions/mirror-action@082a9611ed4b64c796245a62b34584ee2ded6833
uses: yesolutions/[email protected]
with:
# The remote repository e.g. https://github.com/octocat/foo.git or [email protected]:octocat/foo.git
REMOTE: ${{env.REMOTE}} # optional
# The ssh private key for writing to the remote repository, if using ssh
GIT_SSH_PRIVATE_KEY: ${{ secrets.PRIVATEKEY }} # optional
# if true, skips host key verification. Mutually exclusive with GIT_SSH_KNOWN_HOSTS
GIT_SSH_NO_VERIFY_HOST: true # optional, default is false
# Push all refs instead of just the current branch
PUSH_ALL_REFS: true # optional, default is true
# The arugments to use when pushing the repository
GIT_PUSH_ARGS: --tags --force --prune # optional, default is --tags --force --prune
# set to "true" to enable debug mode
DEBUG: false # optional, default is false