title: Using Gitlab deploy keys with write access
body: <p>I am currently running CE version 8.17.4 and am attempting to setup a deploy key with write access (as of 8.16) so that my runner instance may commit build artifacts back to the repository. I took the following steps to set this up:</p>
  
  <ul>
  <li><p>On the runner instance, I generated the ssh keypair with the command: </p>
  
  <p><code>sudo ssh-keygen -t rsa -C "label" -b 4096</code></p></li>
  <li><p>The generated keypair was saved to <strong>/home/gitlab-runner/.ssh/id_rsa</strong> and password protected.</p></li>
  <li>Within Gitlab, I created a public deploy key from the admin console and pasted the contents of <strong>id_rsa.pub</strong> into the appropriate field and verified that the key fingerprints matched. I checked the "Write access allowed" box. </li>
  <li>In the private project that I wished to enable repository access from the runner, I enabled the newly created public deploy key.</li>
  <li><p>This is a LaTeX document respository, so in the <strong>.gitlab-ci.yml</strong> file, I issue the following script after building the pdf:</p>
  
  <p><code>
  after_script:
    - "git commit -am 'autobuild PDF'"
    - "git push origin master"
  </code></p></li>
  </ul>
  
  <p>When the changes were committed, the build ran successfully on the runner up until the <strong>git push origin master</strong> command, and this error was thrown:</p>
  
  <p><code>
  fatal: Authentication failed for 'http://gitlab-ci-token:xxxxxxxxxxxxxxxx@host/project.git/'
  </code></p>
  
  <p>Ok. A couple questions:</p>
  
  <ol>
  <li>If the deploy key is just an SSH key, shouldn't it be connecting on the secure port or does this matter? I haven't found much documentation on <em>using</em> this new write-permission deploy key feature, so am I missing something in the steps I took above?</li>
  <li>Do I need to include <strong>[ci skip]</strong> in the commit message to avoid looping CI builds? I saw this concern come up in the original issue tickets for this feature, but did not see whether this step was required or not. </li>
  </ol>
  
  <p>Thanks for any help!</p>