title: Travis CI: How to generate .travis/deploy_key.pem key for the deployment to remote server
body: <p>As mentioned in the custom deployment page on Travis CI</p>
  
  <p><a href="https://docs.travis-ci.com/user/deployment/custom/#Git" rel="nofollow noreferrer">https://docs.travis-ci.com/user/deployment/custom/#Git</a> </p>
  
  <pre><code>after_success:
    - eval "$(ssh-agent -s)" #start the ssh agent
    - chmod 600 .travis/deploy_key.pem # this key should have push access
    - ssh-add .travis/deploy_key.pem
    - git remote add deploy DEPLOY_REPO_URI_GOES_HERE
    - git push deploy
  </code></pre>
  
  <p>How do I generate <code>.travis/deploy_key.pem</code> key?</p>
  
  <p>Is it something which I should set as an env variable?</p>
  
  <p>My GitHub repo is public and I am trying to deploy the app on <a href="https://www.upcloud.com/" rel="nofollow noreferrer">Upcloud</a> platform. Since Upcloud is not pre supported by TravisCI I need to use <code>after_success</code> step.</p>
  
  <p>Here is my <code>travis.yml</code> file looks so far</p>
  
  <pre><code>language: node_js
  node_js:
    - "node"
  os:
    - linux
  script:
    - yarn test
  after_script:
    # Custome upcloud script should go here. More info https://docs.travis-ci.com/user/deployment/custom/
    # For encrypting keys: https://docs.travis-ci.com/user/encrypting-files/
  notifications:
    slack:
      on_failure: always
  </code></pre>