Skip to content

gitee-sync

gitee-sync #40

Workflow file for this run

name: gitee-sync
on:
push:
branches:
- main
workflow_dispatch:
jobs:
sync:
name: gitee-sync
runs-on: ubuntu-latest
timeout-minutes: 20
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
if: github.actor != 'dependabot[bot]'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure SSH key for Gitee
uses: webfactory/ssh-agent@v0.9.0
with:
ssh-private-key: ${{ secrets.GITEE_PI_SSH }}
- name: Verify Gitee SSH connectivity
shell: bash
run: |
set -euo pipefail
mkdir -p ~/.ssh
ssh-keyscan -H gitee.com >> ~/.ssh/known_hosts
ssh -o BatchMode=yes -T git@gitee.com || true
git ls-remote git@gitee.com:agoraio-community/API-Examples.git HEAD
- name: Mirror repo to Gitee
shell: bash
env:
GIT_TRACE: 1
GIT_CURL_VERBOSE: 1
GIT_TRACE_PACKET: 1
run: |
set -euo pipefail
rm -rf /tmp/API-Examples
git ls-remote https://github.com/Shengwang-Community/API-Examples.git HEAD
git clone --progress --depth 1 --branch main https://github.com/Shengwang-Community/API-Examples.git /tmp/API-Examples
cd /tmp/API-Examples
git remote add gitee git@gitee.com:agoraio-community/API-Examples.git
git push -f gitee main