概要

GitHub ActionsとSCPを使って、さくらのレンタルサーバにビルド結果をコピーする機会がありましたので、その備忘録です。

以下のGitHub Actionsを使用しました。

https://github.com/appleboy/scp-action

つまづいた点

以下の記法で試みたところ、ローカル環境でactを使った際にはうまく動作しましたが、GitHub Actionsで実行した際にはうまくいきませんでした。

nojanom:bbesu:[:inrs--plautsudmneunuwcs:espsasiph:-semethuppst]o:seshosaooafBn::::sesruriu:trstrgliaca:nw:ceelucopaoetsdbtpp$mr$::uiyl{ed{noe{::{"ytnfbtousios$$seu-/lye{{esrlce/c{{ct_ahsrrsstevcesse/eecipteetarska-sccs.vtoa.rr.teuscHeePxrtstOttOt_@hiSssR,tvoT..Tta4pnUPera@}SA}sgsm}ES}tesaRSstwsNW/_otAObfreMR.odrEDtlxd}}te}}"r_path

具体的には、以下のエラーが発生しました。

GitHubactionsworkflowerror:ssh:handshakefailed:ssh:unabletoauthenticate,attemptedmethods[nonepassword],nosupportedmethodsremain

こちらについて以下が参考になりました。

https://stackoverflow.com/questions/71850567/github-actions-workflow-error-ssh-handshake-failed-ssh-unable-to-authenticat

具体的には、以下のように、keypassphaseを用いることで、上記のエラーを回避することができました。

nojanom:bbesu:[:inrs--plautsudmneunuwcs:espsasiph:-semethukppst]o:seshoseaooafBn::::seysruriu:tr:strgliaca:np:ceelucopa$hetsdbtpp$m{a$::uiyl{e{s{noe{:e{"ytnfbs:tousios$eseu-/lye{c$esrlce/c{r{ct_ahsre{rsstevceste/eeciptesstarska-sc.es.vtoa.rPc.teuscHeRrPxrtstOtIeOt_@hiSsVtR,tvoT.AsTta4pnUT.era@}SEP}sgsm}E_A}tesaRKSstwsNES/_otAYPbfreMH.odrE}Rtl}Axd}Ste}E"r_}p}ath

まとめ

同様のことでお困りの方の参考になりましたら幸いです。