更新 .gitea/workflows/sync_repo.yml

This commit is contained in:
2024-11-09 06:44:58 +00:00
parent c4cb868bb3
commit e220ef87ea
2 changed files with 26 additions and 28 deletions

View File

@@ -1,28 +0,0 @@
name: SyncRawFile
on:
push:
paths:
- .gitea/workflows/sync_raw_file.yml # 仅在该文件被修改时触发
schedule:
- cron: "0 * * * *" # 每小时执行一次
jobs:
sync_files:
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Download raw file from GitHub
run: |
mkdir -p ./surge/
curl -o ./surge/China_All.list https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/refs/heads/master/rule/Surge/China/China_All.list
curl -o ./surge/Proxy_All.list https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Proxy/Proxy_All.list
curl -o ./surge/Claude.list https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/Surge/Claude/Claude.list
- name: Commit and push changes
run: |
git config --global user.name "yuanzhen869"
git config --global user.email "yuanzhen869@gmail.com"
git add .
git commit -m "Sync file from GitHub raw" || echo "No changes to commit"
git push origin main

View File

@@ -0,0 +1,26 @@
name: SyncEntireRepo
on:
schedule:
- cron: "0 * * * *" # 每小时执行一次
jobs:
sync_repo:
runs-on: ubuntu-latest
steps:
- name: Configure Git
run: |
git config --global user.name "yuanzhen869"
git config --global user.email "yuanzhen869@gmail.com"
- name: Clone GitHub repository
run: |
git clone --mirror https://github.com/blackmatrix7/ios_rule_script.git repo_sync # 替换为GitHub仓库URL
cd repo_sync
git remote add gitea https://git.halonice.com/yuanzhen869/bypass.git # 替换为Gitea仓库URL
git fetch -p origin
git push -f gitea --all # 推送所有分支
git push -f gitea --tags # 推送所有标签
- name: Clean up
run: |
rm -rf repo_sync