There was an error while loading. Please reload this page.
ssh-keygen -t rsa -b 4096 -f ~/Desktop/ssh_key -C '<project_name>@github-actions'
上記実行により下記ファイルを作成。
~/Desktop/ssh_key
~/Desktop/ssh_key.pub
deploy先サーバーへ接続し、 ~/.ssh/authorized_keys(ない場合は作成してパーミッションを600に) に、1で作った~/Desktop/ssh_key.pubをコピペして追加(ファイル末尾に空行があることを確認)
~/.ssh/authorized_keys
Githubのリポジトリ > Settings > Secrets
事例
SSH_KEY
KNOWN_HOSTS
~/.ssh/known_hosts
[ssh-xxx.heteml.net]:XXXX,[XXX.XXX.XXX.XXX]:XXXX ssh-rsa AAAAB...........Q==
<project>/.github/workflows/deploy.ymlを作成し、内容は下記などを参考に記述。
<project>/.github/workflows/deploy.yml
リポジトリ > Actions タブ