ci: replace hub-mirror-action with direct git push for Gitee sync

Replace Yikun/hub-mirror-action with manual git push for Gitee mirrors. The action HTTPS API call to gitee.com timed out (60s). Use set +e with explicit notice/warning status. Also add .deepseek/ to .gitignore.
This commit is contained in:
whyour 2026-05-18 01:05:46 +08:00
parent 0c5e3b5d04
commit 66f9457be8
2 changed files with 46 additions and 19 deletions

View File

@ -33,14 +33,38 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: Yikun/hub-mirror-action@master - name: Setup SSH and push to Gitee
with: env:
src: github/whyour GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
dst: gitee/whyour run: |
dst_key: ${{ secrets.GITLAB_SSH_PK }} set +e
dst_token: ${{ secrets.GITEE_TOKEN }} mkdir -p ~/.ssh
static_list: "qinglong" printf '%s\n' "${{ secrets.GITLAB_SSH_PK }}" > ~/.ssh/id_rsa
force_update: true chmod 600 ~/.ssh/id_rsa
ssh-keyscan -T 10 gitee.com >> ~/.ssh/known_hosts 2>/dev/null
git remote add gitee git@gitee.com:whyour/qinglong.git 2>/dev/null
if git push --force --all gitee 2>&1; then
echo "::notice::Gitee push --all succeeded"
else
echo "::warning::Push --all failed, trying to create repo via API..."
curl -sS --connect-timeout 30 --max-time 60 \
-X POST "https://gitee.com/api/v5/user/repos" \
-H "Content-Type: application/json" \
-d '{"name":"qinglong","private":"false"}' \
"?access_token=$GITEE_TOKEN" 2>/dev/null
if git push --force --all gitee 2>&1; then
echo "::notice::Gitee push --all succeeded after repo creation"
else
echo "::warning::Gitee push --all failed after retry"
fi
fi
if git push --force --tags gitee 2>&1; then
echo "::notice::Gitee push --tags succeeded"
else
echo "::warning::Gitee push --tags failed"
fi
build-static: build-static:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -98,17 +122,18 @@ jobs:
needs: build-static needs: build-static
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v6 - name: Setup SSH
with: run: |
fetch-depth: 0 mkdir -p ~/.ssh
- uses: Yikun/hub-mirror-action@master echo "${{ secrets.GITLAB_SSH_PK }}" > ~/.ssh/id_rsa
with: chmod 600 ~/.ssh/id_rsa
src: github/whyour ssh-keyscan github.com gitee.com >> ~/.ssh/known_hosts
dst: gitee/whyour - name: Mirror qinglong-static to Gitee
dst_key: ${{ secrets.GITLAB_SSH_PK }} run: |
dst_token: ${{ secrets.GITEE_TOKEN }} git clone --mirror https://github.com/whyour/qinglong-static.git static-mirror
static_list: "qinglong-static" cd static-mirror
force_update: true git remote set-url origin git@gitee.com:whyour/qinglong-static.git
git push --force --mirror
build: build:
if: ${{ !startsWith(github.ref, 'refs/tags/') }} if: ${{ !startsWith(github.ref, 'refs/tags/') }}

2
.gitignore vendored
View File

@ -28,3 +28,5 @@ __pycache__
/shell/preload/notify.* /shell/preload/notify.*
/shell/preload/*-notify.json /shell/preload/*-notify.json
/shell/preload/__ql_notify__.* /shell/preload/__ql_notify__.*
.deepseek/