Files
karuo-ai/.github/workflows/sync_github_to_gitea.yml

40 lines
1.6 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.

# 将 fnvtk 的 GitHub 仓库同步到 CKB NAS Giteaopen.quwanzhi.com:3000
# 触发定时每6小时、手动、或任意 push 时可选触发
# 仓库需配置 SecretsGITEA_TOKEN必填、GITHUB_TOKEN全量同步必填
name: Sync GitHub to CKB NAS Gitea
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch: {}
push:
branches: [ main, master ]
paths-ignore:
- "**.md"
- ".github/workflows/sync_github_to_gitea.yml"
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# 全量同步 fnvtk 下所有仓库时,请在仓库 Secrets 中配置 GH_PATGitHub PATrepo 权限)
- name: Sync GitHub → Gitea
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT || secrets.GITHUB_TOKEN }}
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
GITEA_BASE_URL: "http://open.quwanzhi.com:3000"
GITHUB_USER: "fnvtk"
GITEA_USER: "fnvtk"
SYNC_WORK_DIR: "${{ runner.temp }}/github_gitea_sync"
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq jq
chmod +x "01_卡资/金仓_存储备份/群晖NAS管理/脚本/sync_github_to_gitea.sh" 2>/dev/null || true
if [ -f "01_卡资/金仓_存储备份/群晖NAS管理/脚本/sync_github_to_gitea.sh" ]; then
bash "01_卡资/金仓_存储备份/群晖NAS管理/脚本/sync_github_to_gitea.sh"
else
echo "未找到同步脚本,跳过(请确认仓库结构)。"
fi