<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="250340" data-post-id="250340">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="toranb" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/toranb/120/16117_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  toranb
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p><a class="mention" href="/u/laiboonh" rel="nofollow">@laiboonh</a> I’m with you on this - out of nowhere last week we noticed a “fun” error message using github actions with gigalixir (all documented in this <a href="https://github.com/gigalixir/gigalixir-cli/issues/99" rel="noopener nofollow ugc">issue</a> on gigalixir-cli). They’ve <a href="https://github.com/gigalixir/gigalixir-cli/commit/c817584fea713455783b525fcb3f61f5dcf687cd" rel="noopener nofollow ugc">since</a> extended the ssh options to allow for <code>-tt</code> which works fine from dev local but was still failing with a 255 status exit when run as part of the github actions pipeline.</p>
<p>Here is <a href="https://github.com/toranb/gigalixir-action/commit/e919a3bd1d51f5ee36df28a197f1f4cc503b6924" rel="noopener nofollow ugc">my fork</a> that does show the <code>-tt</code> option during migrate.</p>
<p>After the change above^ I don’t get the error <code>Pseudo-terminal will not be allocated because stdin is not a terminal</code> but the journey doesn’t end there. Next I found that my public key was denied (interesting given this was never a problem before last week).</p>
<p><code>Running migrations   root@v2018-us-central1.gcp.ssh.gigalixir.com: Permission denied (publickey).   Command '['ssh', '-tt', 'root@v2018-us-central1.gcp.ssh.gigalixir.com', '-p', '31266', 'gigalixir_run', 'migrate']' returned non-zero exit status 255.</code></p>
<p>To get around this problem I generated a new ssh key like so</p>
<p><code>ssh-keygen -t ed25519 -C "email@here.com"</code></p>
<p>Next, copy the private key and create a new secret for Github Actions named <code>SSH_PRIVATE_KEY</code></p>
<p><code>pbcopy &lt; id_ed23456</code></p>
<p>Finally, from your local machine add the public key to gigalixir</p>
<p><code>gigalixir account:ssh_keys:add "$(cat ~/.ssh/id_ed23456.pub)"</code></p>
<p>And now when you kick this deploy using github actions it’s running migrations without issue. Big thanks to <a class="mention" href="/u/mhanberg" rel="nofollow">@mhanberg</a> and I’ve opened an <a href="https://github.com/mhanberg/gigalixir-action/issues/46" rel="noopener nofollow ugc">issue</a> on the main github project for others to benefit</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="250340" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/gigalixir-action-github-action-to-deploy-applications-to-gigalixir-and-run-your-ecto-migrations-automatically/37589/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-250340" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="250340"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>