Skip to content

Commit 66f9457

Browse files
committed
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.
1 parent 0c5e3b5 commit 66f9457

2 files changed

Lines changed: 46 additions & 19 deletions

File tree

.github/workflows/build-docker-image.yml

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,38 @@ jobs:
3333
- uses: actions/checkout@v6
3434
with:
3535
fetch-depth: 0
36-
- uses: Yikun/hub-mirror-action@master
37-
with:
38-
src: github/whyour
39-
dst: gitee/whyour
40-
dst_key: ${{ secrets.GITLAB_SSH_PK }}
41-
dst_token: ${{ secrets.GITEE_TOKEN }}
42-
static_list: "qinglong"
43-
force_update: true
36+
- name: Setup SSH and push to Gitee
37+
env:
38+
GITEE_TOKEN: ${{ secrets.GITEE_TOKEN }}
39+
run: |
40+
set +e
41+
mkdir -p ~/.ssh
42+
printf '%s\n' "${{ secrets.GITLAB_SSH_PK }}" > ~/.ssh/id_rsa
43+
chmod 600 ~/.ssh/id_rsa
44+
ssh-keyscan -T 10 gitee.com >> ~/.ssh/known_hosts 2>/dev/null
45+
git remote add gitee git@gitee.com:whyour/qinglong.git 2>/dev/null
46+
47+
if git push --force --all gitee 2>&1; then
48+
echo "::notice::Gitee push --all succeeded"
49+
else
50+
echo "::warning::Push --all failed, trying to create repo via API..."
51+
curl -sS --connect-timeout 30 --max-time 60 \
52+
-X POST "https://gitee.com/api/v5/user/repos" \
53+
-H "Content-Type: application/json" \
54+
-d '{"name":"qinglong","private":"false"}' \
55+
"?access_token=$GITEE_TOKEN" 2>/dev/null
56+
if git push --force --all gitee 2>&1; then
57+
echo "::notice::Gitee push --all succeeded after repo creation"
58+
else
59+
echo "::warning::Gitee push --all failed after retry"
60+
fi
61+
fi
62+
63+
if git push --force --tags gitee 2>&1; then
64+
echo "::notice::Gitee push --tags succeeded"
65+
else
66+
echo "::warning::Gitee push --tags failed"
67+
fi
4468
4569
build-static:
4670
runs-on: ubuntu-latest
@@ -98,17 +122,18 @@ jobs:
98122
needs: build-static
99123
runs-on: ubuntu-latest
100124
steps:
101-
- uses: actions/checkout@v6
102-
with:
103-
fetch-depth: 0
104-
- uses: Yikun/hub-mirror-action@master
105-
with:
106-
src: github/whyour
107-
dst: gitee/whyour
108-
dst_key: ${{ secrets.GITLAB_SSH_PK }}
109-
dst_token: ${{ secrets.GITEE_TOKEN }}
110-
static_list: "qinglong-static"
111-
force_update: true
125+
- name: Setup SSH
126+
run: |
127+
mkdir -p ~/.ssh
128+
echo "${{ secrets.GITLAB_SSH_PK }}" > ~/.ssh/id_rsa
129+
chmod 600 ~/.ssh/id_rsa
130+
ssh-keyscan github.com gitee.com >> ~/.ssh/known_hosts
131+
- name: Mirror qinglong-static to Gitee
132+
run: |
133+
git clone --mirror https://github.com/whyour/qinglong-static.git static-mirror
134+
cd static-mirror
135+
git remote set-url origin git@gitee.com:whyour/qinglong-static.git
136+
git push --force --mirror
112137
113138
build:
114139
if: ${{ !startsWith(github.ref, 'refs/tags/') }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,5 @@ __pycache__
2828
/shell/preload/notify.*
2929
/shell/preload/*-notify.json
3030
/shell/preload/__ql_notify__.*
31+
32+
.deepseek/

0 commit comments

Comments
 (0)