carrot/.github/workflows/sync-to-gitea.yml
2024-12-07 17:03:01 +08:00

29 lines
905 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: Sync to Gitea
on:
push:
branches:
- main # 你可以指定特定的分支比如master或者其他分支
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repository
uses: actions/checkout@v3
- name: Set up Git
uses: actions/setup-git@v2
with:
git_user_name: 'Your Name'
git_user_email: 'your-email@example.com'
- name: Push to Gitea
env:
GITEA_URL: 'http://124.220.61.41:5000' # 你的Gitea地址
GITEA_REPO: 'zhudongjer/openpilot' # Gitea上的仓库名
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} # GitHub Secrets中配置的Gitea访问令牌
run: |
git remote add gitea https://your_gitea_user:${{ secrets.GITEA_TOKEN }}@${GITEA_URL}/api/v1/repos/${GITEA_REPO}/push
git push gitea main # 如果你推送的是其他分支,请修改为相应分支名