Inputs ​
đź’ˇ Click on the Input Name for more Details.
Input Name | Default Value | Short Description of the Input Value |
---|---|---|
host | Required | Remote Docker Hostname or IP |
port | 22 | Remote Docker Port |
user | Required | Remote Docker Username |
pass | Required | Remote Docker Password |
ssh_key | Required | Remote SSH Key File |
registry_host | - | Registry Authentication Host |
registry_user | - | Registry Authentication Username |
registry_pass | - | Registry Authentication Password |
See the Examples section for more options.
Details ​
host Required ​
The hostname or IP address of the remote docker server to deploy too. If your hostname is behind a proxy like Cloudflare you will need to use the IP address.
You may be able to find your Public IP with one of these commands.
curl ip.me
curl -4 ifconfig.co
echo $(wget -qO- https://ipecho.net/plain)
dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
port ​
SSH Port. Only set this if using a non-standard port.
Default: 22
user Required ​
SSH Username. This user must have permissions to access docker.
If you use sudo
or the root
user to access docker, it is recommended you grant docker access to another user or service account.
Replace mynewuser
with your actual username.
sudo usermod -aG docker mynewuser
After this you should be able to run docker
commands as mynewuser
without sudo
. Note, you may need to log out and back in for the changes to take effect.
pass Required ​
You must provide either a pass
or ssh_key, but not both.
When using a password, a temporary key is generated using ssh-keygen and copied to the host with ssh-copy-id using sshpass. The authorized_keys file entry is cleaned up after each deploy.
ssh_key Required ​
You must provide either a ssh_key
or pass, but not both.
To generate an SSH key, run the following as the deployment user:
ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519 -N ""
cat ~/.ssh/id_ed25519
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
cat ~/.ssh/id_rsa
registry_host ​
To run docker login on another registry.
Example: ghcr.io
registry_pass ​
Required to run docker login before stack deploy.
registry_user ​
Required to run docker login before stack deploy.
Examples ​
steps:
- name: 'Docker Context'
uses: cssnr/docker-context-action@v1
with:
host: ${{ secrets.DOCKER_HOST }}
user: ${{ secrets.DOCKER_USER }}
port: 22 # 22 is the default value - optional
pass: ${{ secrets.DOCKER_PASS }} # or ssh_key - optional
ssh_key: ${{ secrets.DOCKER_SSH_KEY }} # or pass - optional
- name: 'Inspect Docker'
runs: |
docker context ls
docker context inspect
docker info
docker ps
Â
WARNING
These docs are not finished. Please see the README.md on GitHub.