baradhili
baradhili

Reputation: 584

Puzzling deployphp ssh fail

This is the deploy snippet in my github deploy.yml

- name: Deploy
      uses: deployphp/action@v1
      with:
        private-key: ${{ secrets.PRIVATE_KEY }}
        dep: deploy ${{ secrets.SSH_HOST }} -o branch=main -o keep_releases=3 -vvv

PRIVATE_KEY and SSH_HOST are defined in my github actions secrets

However, I keep seeing this error in the deploy log

Run deployphp/action@v1
$ ssh-agent -a /tmp/ssh-auth.sock
SSH_AUTH_SOCK=/tmp/ssh-auth.sock; export SSH_AUTH_SOCK;
SSH_AGENT_PID=3422; export SSH_AGENT_PID;
echo Agent pid 3422;
Using "vendor/bin/dep".
Invalid JSON in options
$ php vendor/bin/dep deploy *** -o branch=main -o keep_releases=3 -vvv --no-interaction --ansi -v 
task deploy:info
task deploy:setup
  [***] /usr/bin/php8.1 /home/runner/work/laravel-api/laravel-api/vendor/***/***/dep worker --port 40175 --task deploy:setup --host *** --option branch=main --option keep_releases=3 --ansi --no-interaction --decorated -vvv
  [***] ssh '-A' '-o' 'ControlMaster=auto' '-o' 'ControlPersist=60' '-o' 'ControlPath=/dev/shm/***@113.30.151.149' '***@113.30.151.149' ': 0f89c0c962742bac1f0b; bash -ls'
  [***] run [ -d /var/www/html ] || mkdir -p /var/www/html;
  cd /var/www/html;
  [ -d .dep ] || mkdir .dep;
  [ -d releases ] || mkdir releases;
  [ -d shared ] || mkdir shared;
  [***] Warning: Permanently added '113.30.151.149' (ED25519) to the list of known hosts.
  [***] Permission denied, please try again.
  [***] Permission denied, please try again.
  [***] ***@113.30.151.149: Permission denied (publickey,password).
  [***]  error  in setup.php on line 7:
  [***] exit code -1 (Unknown error)
ERROR: Task deploy:setup failed!
task deploy:failed
task deploy:unlock
ERROR: Task deploy:unlock failed!
Error: Failed: dep deploy,***,-o,branch=main,-o,keep_releases=3,-vvv

using sshpass-action I have confirmed it can actually login to the server from the github, and I've also tested locally using the private key and it has no problems logging in.. Looking at the server logs I see github actions trying to login via ssh using a password instead of a key. (key is allowed and works fine)

Any suggestions as to where to look?

Upvotes: 0

Views: 108

Answers (1)

baradhili
baradhili

Reputation: 584

I'm a fool.. the name of the github secret var was SSH_PRIVATE_KEY and the script asks for PRIVATE_KEY... though the error gives you no clues..

Upvotes: 0

Related Questions