Skip to content

Commit cdb9796

Browse files
committed
feat: update workflow and sync to coding.net
1 parent cc68428 commit cdb9796

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/sync.yml

+21
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,24 @@ jobs:
1515
with:
1616
source-repo: "git@github.com:doocs/leetcode.git"
1717
destination-repo: "git@gitee.com:Doocs/leetcode.git"
18+
19+
- name: Set ssh environment
20+
env:
21+
SSH_PRIVATE_KEY: ${{ secrets.RSA_PRIVATE_KEY }}
22+
run: |
23+
mkdir -p ~/.ssh/
24+
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
25+
chmod 600 ~/.ssh/id_rsa
26+
ssh-keyscan github.com > ~/.ssh/known_hosts
27+
chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
28+
git config --global user.name "yanglbme"
29+
git config --global user.email "szuyanglb@outlook.com"
30+
31+
- name: Sync to coding.net
32+
run: |
33+
cd /tmp
34+
git clone git@github.com:doocs/leetcode.git leetcode
35+
cd leetcode
36+
git checkout master
37+
git remote add coding git@e.coding.net:doocs/leetcode.git
38+
git push coding master

0 commit comments

Comments
 (0)