26
prepare-ssh/action.yml
Normal file
26
prepare-ssh/action.yml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
name: SSH 준비
|
||||||
|
description: SSH 키를 설정하고 호스트를 known_hosts에 추가하는 스크립트
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
ssh-key:
|
||||||
|
required: true
|
||||||
|
host:
|
||||||
|
required: true
|
||||||
|
key-path:
|
||||||
|
required: false
|
||||||
|
default: ~/.ssh/deploy_key
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- shell: bash
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
|
||||||
|
printf '%s\n' "${{ inputs.ssh-key }}" > ${{ inputs.key-path }}
|
||||||
|
chmod 600 ${{ inputs.key-path }}
|
||||||
|
|
||||||
|
ssh-keyscan -H "${{ inputs.host }}" >> ~/.ssh/known_hosts
|
||||||
Reference in New Issue
Block a user