carrot/.github/workflows/push2gitee.yml
2025-06-22 17:45:30 +08:00

34 lines
946 B
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.

name: Daily Sync to Gitee
on:
schedule:
- cron: '0 2 * * *' # 每天UTC时间2点执行北京时间10点
workflow_dispatch: # 支持手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v4
- name: Configure Git
run: |
git config --global user.name "github-actions"
git config --global user.email "github-actions@github.com"
- name: Add Gitee remote and force push
env:
GITEE_USERNAME: zhudongjer
GITEE_TOKEN: 11f606dc48ee2c481918e169b2291fb3c4705cdf
run: |
# 添加 Gitee 远程地址HTTP + Token
git remote add gitee http://$GITEE_USERNAME:$GITEE_TOKEN@49.235.152.15:3000/$GITEE_USERNAME/carrot.git
# 强制推送当前分支(假设为 master
git push gitee master --force
# 推送标签(如果有)
git push gitee --tags