Mirror from Gitea to GitHub #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Mirror from Gitea to GitHub | |
on: | |
schedule: | |
- cron: '0 0 * * *' # Adjust this to your preferred schedule | |
workflow_dispatch: # Add this event to allow manual runs | |
jobs: | |
mirror: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Check if GIT_REPO is set | |
run: echo ${{ env.GIT_REPO }} | |
- name: Fetch Gitea Repository | |
run: | | |
git fetch --prune --tags origin | |
git remote set-head origin -a | |
env: | |
GIT_REPO: 'https://git.howtoit.com/LoadingStill/Linux.git' # Change this to your Gitea repository URL | |
- name: Push to GitHub | |
run: | | |
git push --mirror https://${{ secrets.TOKEN_GITHUB }}@github.com/LoadingStill/Linux.git | |
env: | |
GITHUB_REPO: 'https://github.com/LoadingStill/Linux.git' # Change this to your GitHub repository URL |