Skip to content

Commit

Permalink
Adding a gitee repository synchronisation process (mineadmin#174)
Browse files Browse the repository at this point in the history
* Added Sync gitee actions
---------

Co-authored-by: Death-Satan <[email protected]>
  • Loading branch information
zds-s and zds-s authored Mar 13, 2024
1 parent 26a2fef commit 9309fee
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/sync-gitee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Sync Gitee Repository

on:
schedule:
- cron: '* 1 * * *'

jobs:
sync:
runs-on: ubuntu-latest
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Private Key
run: |
mkdir -p ~/.ssh
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo "StrictHostKeyChecking no" >> ~/.ssh/config
- name: Push Mirror
env:
SOURCE_REPO: 'https://github.com/mineadmin/mineadmin.git'
DESTINATION_REPO: '[email protected]:mineadmin/mineadmin.git'
run: |
git clone --mirror "$SOURCE_REPO" && cd `basename "$SOURCE_REPO"`
git remote set-url --push origin "$DESTINATION_REPO"
git fetch -p origin
git for-each-ref --format 'delete %(refname)' refs/pull | git update-ref --stdin
git push --mirror

0 comments on commit 9309fee

Please sign in to comment.