Skip to content

Commit c4dd053

Browse files
committed
edu service syn to ncp test
1 parent 534c772 commit c4dd053

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

.github/workflows/syn-ncp.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Sync to NCP SourceCommit
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
sync:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Setup SSH for NCP SourceCommit
18+
run: |
19+
mkdir -p ~/.ssh/
20+
echo "${{ secrets.NCP_SOURCECOMMIT_SSH_KEY }}" > ~/.ssh/ncp_private_key
21+
chmod 600 ~/.ssh/ncp_private_key
22+
23+
cat <<EOF >> ~/.ssh/config
24+
Host devtools.ncloud.com
25+
User ${{ secrets.NCP_SOURCECOMMIT_USER }}
26+
IdentityFile ~/.ssh/ncp_private_key
27+
HostkeyAlgorithms +ssh-rsa
28+
PubkeyAcceptedAlgorithms +ssh-rsa
29+
EOF
30+
31+
ssh-keyscan -H devtools.ncloud.com >> ~/.ssh/known_hosts
32+
33+
- name: Test SSH Connection (after setting up key)
34+
run: ssh -v devtools.ncloud.com || true
35+
36+
- name: Push to NCP SourceCommit
37+
run: |
38+
git remote add ncp "ssh://devtools.ncloud.com/3067145/fn-edu-service.git"
39+
git push ncp main --force

0 commit comments

Comments
 (0)