ssh-action
ssh-action copied to clipboard
Permission denied on git pull
Hey, I've a problem and I don't understand how to fix it!
When I try to push something on github my action returns:
======CMD====== cd ./fieroo.***gital.com && .scripts/deploy.sh ======END====== out: Deployment started ... out: Application is already down. err: Permission denied (publickey). err: fatal: Could not read from remote repository. err: Please make sure you have the correct access rights err: and the repository exists. 2023/08/09 16:11:26 Process exited with status 1
so the .scripts/deploy.sh was blocked when it try to do a simple git pull
this is the complete action:
name: Deploy
on: push: branches: - master pull_request: branches: - master
jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Deploy to server uses: appleboy/ssh-action@master with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} port: ${{ secrets.PORT }} key: ${{ secrets.SSHKEY }} passphrase: ${{ secrets.PASSPHRASE }} script: "cd ./fieroo.belicedigital.com && .scripts/deploy.sh"
and this is the complete .scripts/deploy.sh:
set -e
echo "Deployment started ..."
(php artisan down) || true
git pull origin master
composer install
php artisan clear-compiled
php artisan optimize
npm run dev
php artisan migrate --force
php artisan up
echo "Deployment finished!"
you can check from the output of the action that it is blocked after 2 output (the echo, and the php artisan down), so it is blocked from the git pull command.
can anyone help me?
thanks
If you run the CMD/payload without the remote access, does still give you the error?
please see https://github.com/appleboy/ssh-action/issues/232#issuecomment-1506493783