Howdy folks! The project has been around for a while, figured I should finally share it here.
The Gigalixir Action is a GitHub Action should can use in your workflows to deploy applications to Gigalixir and run your Ecto migrations automatically.
I will also comment off the bat that the Gigalixir CLI is written in Python, and there are some widespread issue with Python going on right now from what I hear, so you will probably need to explicitly use the latest Python version in your workflow using this example.
I am currently having migration issues. I have checked that i only have one public key with gigalixir. I have also checked that i have private key as a secret in github repo.
Running migrations
/opt/hostedtoolcache/Python/3.8.1/x64/bin/gigalixir ps:migrate -a <APP_NAME>
Pseudo-terminal will not be allocated because stdin is not a terminal.
Warning: Permanently added '[v2018-us-central1.gcp.ssh.gigalixir.com]:30654,[35.224.115.157]:30654' (ECDSA) to the list of known hosts.
root@v2018-us-central1.gcp.ssh.gigalixir.com: Permission denied (publickey).
Command '['ssh', '-t', 'root@v2018-us-central1.gcp.ssh.gigalixir.com', '-p', '30654', 'gigalixir_run', 'migrate']' returned non-zero exit status 255.
I have tried to run gigalixir client locally with success
âžś git:(main) gigalixir ps:migrate -a <APP_NAME>
14:56:20.023 [info] Migrations already up
Connection to v2018-us-central1.gcp.ssh.gigalixir.com closed.
I am running out of ideas here. So trying my luck here to see if anyone had similar problems before
@laiboonh 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 issue on gigalixir-cli). They’ve since extended the ssh options to allow for -tt which works fine from dev local but was still failing with a 255 status exit when run as part of the github actions pipeline.
Here is my fork that does show the -tt option during migrate.
After the change above^ I don’t get the error Pseudo-terminal will not be allocated because stdin is not a terminal 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).
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.
To get around this problem I generated a new ssh key like so
ssh-keygen -t ed25519 -C "email@here.com"
Next, copy the private key and create a new secret for Github Actions named SSH_PRIVATE_KEY
pbcopy < id_ed23456
Finally, from your local machine add the public key to gigalixir
And now when you kick this deploy using github actions it’s running migrations without issue. Big thanks to @mhanberg and I’ve opened an issue on the main github project for others to benefit