Files
jd_scripts/.github/workflows/repo_sync.yml
2020-11-10 09:29:58 +08:00

42 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# File: .github/workflows/repo-sync.yml
name: sync-lxk0301-scripts
on:
schedule:
- cron: '1 0,15 * * *'
workflow_dispatch:
watch:
types: started
push:
branches: [ master ]
repository_dispatch:
types: sync-lxk0301-scripts
jobs:
repo-sync:
env:
PAT: ${{ secrets.PAT }} #此处PAT需要申请教程详见https://www.jianshu.com/p/bb82b3ad1d11
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: sync lxk0301-scripts
uses: repo-sync/github-sync@v2
if: env.PAT
with:
source_repo: "https://github.com/lxk0301/scripts.git"
source_branch: "master"
destination_branch: "master"
github_token: ${{ secrets.PAT }}
# 我自己同步到gitee使用其他人可忽略
- name: sync github -> gitee
uses: Yikun/hub-mirror-action@master
if: env.dst_key
with:
src: github/lxk0301
dst: gitee/lxk0301
static_list: "scripts"
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}