I am trying to setup CD to my VPS using github acitons.
But I am getting this error:
err: [email protected]: 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.
Here is my workflow.yml
name: Worldcorp dev CD
on:
push:
branches: [ dev ]
env:
MODE: DEV
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Deploy using ssh
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
port: 22
script: |
cd /home/worldcorp/backend/dev/main/
git pull origin dev
- run: npm install --only=prod
- run: npm run build
- name: Restart pm2
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.PRIVATE_KEY }}
port: 22
script: |
pm2 restart wc-main-back