I ended up using appleboy for this with a great deal of success:
https://github.com/appleboy/ssh-action
Answer from Nicole Staline on Stack OverflowContinuous deployment from GitHub Action to Google Cloud VM using Docker - Stack Overflow
google cloud platform - How to deploy GCP compute vm server using github actions terraform - Stack Overflow
SSH to GCP VM from GitHub Actions using Workload Identity Federation
Github actions to google cloud run takes about 7 mins. Is that normal?
Videos
Hi, is it possible to SSH into GCP VM instance from GitHub Actions using Workload Identity Federation (therefore use the Service Account tied to it)? Is it even recommended? I tried to use glcoud beta compute sshbut I still could not get it to work (I can provide the details if need be).
My hope is to not have to a use a GCP IAM User in my GitHub Actions workflow (which seems to be required if I want to use OS Login for ssh access). I also don't want to manually save a ssh key in my VM since I would have to do that every time I recreate the VM.
NOTE: I am using terraform and OS Login for bringing up the VM and running commands on it. This is not incorporated into my GitHub actions workflow. In my GitHub actions workflow, I only intend to push a new docker image to registry, SSH into the VM, pull the new Docker image, and recreate the container.
Would appreciate any help, thank you!