26 lines
548 B
YAML
26 lines
548 B
YAML
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 |