title: Github Workflow Actions And EC2: Error Loading Key Invalid Format
body: <p>I am trying to set up CI for my nodejs server. I would like to use github actions to ssh into my ec2 instance, where I can then git clone/pull my updated repo.</p>
  
  <p>I can ssh into my ec2 instance on my local machine w no issues. I just do something like: "ssh -i keypar.pem username@some-ip.region.compute.amazonaws.com" and it connects. However, I can't seem to get a connection working on the worflow/actions script. Here is what I have in my workflow yml file:</p>
  
  <p>name: CI</p>
  
  <p>on: [push]</p>
  
  <p>jobs:
    build:</p>
  
  <pre><code>runs-on: ubuntu-latest
  
  steps:
  - name: Connect
    env:
      DEPLOY_KEY: ${{ secrets.EC2 }}
    run: |
      eval `ssh-agent`
      ssh-add - &lt;&lt;&lt; "${DEPLOY_KEY}"
      ssh ec2-user@ec2-instance-ip-here.us-east-2.compute.amazonaws.com
  </code></pre>
  
  <p>This script gets me the error <strong>"Error loading key "(stdin)": invalid format"</strong>. Also when I look at the deploy key section under repo settings, it says the key has never been used.</p>
  
  <p>(Obviously I would need to install, clone, and perform other steps in addition to what is listed above.)</p>
  
  <p>In summary:</p>
  
  <p>1 how to I fix the invalid format error?</p>
  
  <p>2 how do I load and reference the key pair?</p>