shimataro / ssh-key-action

GitHub Action that installs SSH key to .ssh
https://github.com/marketplace/actions/install-ssh-key
MIT License
581 stars 87 forks source link

Error loading key "/home/runner/.ssh/deploy_key": invalid format while format is RSA #205

Closed arjendevos closed 2 years ago

arjendevos commented 2 years ago

My key is just an RSA key and i've added it to the SECRETS in github. This is my setup:

- name: Setup SSH key
        uses: shimataro/ssh-key-action@v2
        with:
          key: ${{ env.SSH_KEY }}
          name: deploy_key # optional
          known_hosts: unnecessary
          if_key_exists: ignore # replace / ignore / fail; optional (defaults to fail)
- name: Deploy to server
        run: |
          eval `ssh-agent -s`
          ssh-add ~/.ssh/deploy_key
          rsync -avz ./backend/dist/ root@$SSH_HOST:/serve/backend/
          rsync -avz ./frontend/.next/ root@$SSH_HOST:/serve/frontend/
arjendevos commented 2 years ago

There was a \ at the end of the file