carrot/.github/workflows/push2gitee.yml
机械小鸽 0ae848f6cf
Some checks failed
Sync to Private Gitee / sync (push) Has been cancelled
Sync Branch / sync (push) Has been cancelled
Update push2gitee.yml
new
2025-06-22 17:16:24 +08:00

31 lines
841 B
YAML

name: Sync to Private Gitee
on:
schedule:
- cron: '0 1 * * *' # 每天 UTC 1 点(北京时间 9 点)
workflow_dispatch: # 支持手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repository (full history)
uses: actions/checkout@v3
with:
fetch-depth: 0 # ⬅️ 关键修改,避免 shallow clone 错误
- name: Set Git config
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
- name: Add Gitee remote
run: |
git remote add gitee http://${{ secrets.GITEE_USERNAME }}:${{ secrets.GITEE_TOKEN }}@49.235.152.15:3000/zhudongjer/carrot.git
- name: Force push to Gitee
run: |
git push gitee --force --all
git push gitee --force --tags