ci: better ssh setup
This commit is contained in:
@@ -17,12 +17,15 @@ jobs:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup SSH Key
|
||||
env:
|
||||
SSH_KEY: ${{ secrets.DEPLOY_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519
|
||||
chmod 700 ~/.ssh
|
||||
echo "$SSH_KEY" > ~/.ssh/id_ed25519
|
||||
chmod 600 ~/.ssh/id_ed25519
|
||||
# Thêm host vào known_hosts để không bị hỏi yes/no
|
||||
ssh-keyscan git.demonkernel.io.vn >> ~/.ssh/known_hosts
|
||||
ssh-keyscan -t ed25519 git.demonkernel.io.vn >> ~/.ssh/known_hosts
|
||||
ssh -i ~/.ssh/id_ed25519 -o BatchMode=yes -o StrictHostKeyChecking=no git@git.demonkernel.io.vn "say_hello" || true
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v5
|
||||
|
||||
Reference in New Issue
Block a user