I'd like to automate the deployment of Docker containers to a VPS,
using gcloud auth configure-docker
to set the proper docker credentials on the VPS.
This works fine when I'm
- A: logged in as root in the online console in Webmin
- B: logged in as root trough SSH from a Windows 11 terminal
- C: logged in as (let's say) myuser trough SSH from a Windows 11 terminal
So, for example, I can do from Windows 11:
ssh myuser@vpsip
*type in password*
gcloud auth configure-docker
The problem is, the same command fails when I try to execute it from a Github Actions pipleine:
- name: Deploy Docker image to VPS
uses: appleboy/ssh-action@v0.1.7
with:
host: vpsip
username: myuser
password: mypassword
port: myport
script: |
whoami
ls
gcloud auth configure-docker
This is incredibly weird since the whoami
command returns myuser, so I'd consider that validated. The ls
command also runs fine, so the login was successful, but the gcloud
command fails with the error: "err: bash: line 2: gcloud: command not found"
My conclusion is that the pipeline or appleboy's action somehow messes up something, since I definitely can use the gcloud command with user "myuser" trough SSH if I start a session from a normal Windows 11 terminal.
The VPS is running Ubuntu 18.
Thank you!