<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xml:base="https://docs.spec-kitty.ai/operations/ssh-deploy-keys/">
  <id>https://docs.spec-kitty.ai/operations/ssh-deploy-keys/</id>
  <title>SSH Deploy Key Setup for CI/CD</title>
  <updated>2026-01-29T00:00:00.000Z</updated>
  <author><name>Spec Kitty</name></author>
  <link rel="alternate" type="text/html" href="https://docs.spec-kitty.ai/operations/ssh-deploy-keys/"/>
  <summary>One-time setup for the SSH deploy key that lets CI/CD clone the private spec-kitty-events repository during builds: generating the keypair and registering the public key.</summary>
  <content type="html">&lt;span id=&quot;ssh-deploy-key-setup-for-cicd&quot;&gt;&lt;/span&gt;
&lt;h2 id=&quot;purpose&quot;&gt;Purpose&lt;/h2&gt;
&lt;p&gt;Spec-kitty depends on the private &lt;code dir=&quot;auto&quot;&gt;spec-kitty-events&lt;/code&gt; library. CI/CD (GitHub Actions) needs an SSH deploy key to clone this repository during builds.&lt;/p&gt;
&lt;h2 id=&quot;setup-steps-one-time&quot;&gt;Setup Steps (One-Time)&lt;/h2&gt;
&lt;h3 id=&quot;1-generate-ssh-key-pair&quot;&gt;1. Generate SSH Key Pair&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;ssh-keygen&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;-t&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;ed25519&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;-C&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#984E4D&quot;&gt;spec-kitty-ci-deploy-key&lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;-f&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;spec-kitty-events-deploy-key&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;-N&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#D9F5DD;--1:#111111&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;p&gt;This creates two files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty-events-deploy-key&lt;/code&gt; (private key - for GitHub Actions secret)&lt;/li&gt;
&lt;li&gt;&lt;code dir=&quot;auto&quot;&gt;spec-kitty-events-deploy-key.pub&lt;/code&gt; (public key - for spec-kitty-events repo)&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;2-add-public-key-to-spec-kitty-events-repository&quot;&gt;2. Add Public Key to spec-kitty-events Repository&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty-events/settings/keys&quot;&gt;https://github.com/spec-kitty/spec-kitty-events/settings/keys&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Click “Add deploy key”&lt;/li&gt;
&lt;li&gt;Title: “spec-kitty CI/CD Read-Only”&lt;/li&gt;
&lt;li&gt;Key: Paste contents of &lt;code dir=&quot;auto&quot;&gt;spec-kitty-events-deploy-key.pub&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Important&lt;/strong&gt;: Leave “Allow write access” UNCHECKED (read-only)&lt;/li&gt;
&lt;li&gt;Click “Add key”&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;3-add-private-key-to-spec-kitty-repository-secrets&quot;&gt;3. Add Private Key to spec-kitty Repository Secrets&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;a href=&quot;https://github.com/spec-kitty/spec-kitty/settings/secrets/actions&quot;&gt;https://github.com/spec-kitty/spec-kitty/settings/secrets/actions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Click “New repository secret”&lt;/li&gt;
&lt;li&gt;Name: &lt;code dir=&quot;auto&quot;&gt;SPEC_KITTY_EVENTS_DEPLOY_KEY&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Value: Paste contents of &lt;code dir=&quot;auto&quot;&gt;spec-kitty-events-deploy-key&lt;/code&gt; (PRIVATE key, entire file)&lt;/li&gt;
&lt;li&gt;Click “Add secret”&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;4-delete-local-key-files-security&quot;&gt;4. Delete Local Key Files (Security)&lt;/h3&gt;
&lt;div class=&quot;expressive-code&quot;&gt;&lt;figure class=&quot;frame is-terminal not-content&quot;&gt;&lt;figcaption class=&quot;header&quot;&gt;&lt;span class=&quot;title&quot;&gt;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Terminal window&lt;/span&gt;&lt;/figcaption&gt;&lt;pre data-language=&quot;bash&quot;&gt;&lt;code&gt;&lt;div class=&quot;ec-line&quot;&gt;&lt;div class=&quot;code&quot;&gt;&lt;span style=&quot;--0:#82AAFF;--1:#3B61B0&quot;&gt;rm&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;spec-kitty-events-deploy-key&lt;/span&gt;&lt;span style=&quot;--0:#D6DEEB;--1:#403F53&quot;&gt; &lt;/span&gt;&lt;span style=&quot;--0:#ECC48D;--1:#3B61B0&quot;&gt;spec-kitty-events-deploy-key.pub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;&lt;/div&gt;
&lt;h2 id=&quot;verification&quot;&gt;Verification&lt;/h2&gt;
&lt;p&gt;After setup, GitHub Actions can access spec-kitty-events. Test by triggering a workflow run (see &lt;code dir=&quot;auto&quot;&gt;.github/workflows/ci.yml&lt;/code&gt;).&lt;/p&gt;
&lt;h2 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Error: “Permission denied (publickey)”&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Check that public key was added to spec-kitty-events repo (Step 2)&lt;/li&gt;
&lt;li&gt;Check that private key secret name matches exactly: &lt;code dir=&quot;auto&quot;&gt;SPEC_KITTY_EVENTS_DEPLOY_KEY&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Error: “Could not read from remote repository”&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Verify SSH URL in pyproject.toml uses &lt;code dir=&quot;auto&quot;&gt;git+ssh://git@github.com/...&lt;/code&gt; format&lt;/li&gt;
&lt;li&gt;Verify deploy key has read access to spec-kitty-events repository&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;key-rotation&quot;&gt;Key Rotation&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Rotate every 12 months or immediately if compromised.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Follow the same steps above to generate new keys, then:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add new public key to spec-kitty-events (don’t remove old key yet)&lt;/li&gt;
&lt;li&gt;Update secret in spec-kitty with new private key&lt;/li&gt;
&lt;li&gt;Trigger a test build to verify new key works&lt;/li&gt;
&lt;li&gt;Remove old public key from spec-kitty-events&lt;/li&gt;
&lt;/ol&gt;</content>
</entry>
