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