Files

58 lines
1.9 KiB
Markdown
Raw Permalink Normal View History

2021-12-25 23:47:30 +07:00
# Docker Remote Deployment Action
A [GitHub Action](https://github.com/marketplace/actions/docker-remote-deployment) that supports docker-compose and Docker Swarm deployments on a remote host using SSH.
2021-12-25 23:52:34 +07:00
The Action is adapted from work by [wshihadeh](https://github.com/wshihadeh/docker-deployment-action) and [TapTap21](https://github.com/TapTap21/docker-remote-deployment-action)
2021-12-25 23:47:30 +07:00
## Example
Below is a brief example on how the action can be used:
```yaml
- name: Deploy to Docker swarm
uses: sulthonzh/docker-remote-deployment-action@v1
with:
remote_docker_host: user@host
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }}
deployment_mode: docker-swarm
copy_stack_file: true
deploy_path: /root/my-deployment
stack_file_name: docker-compose.yaml
keep_files: 5
args: my_applicaion
```
## Input Configurations
### `remote_docker_host`
2024-03-08 18:46:09 +08:00
Remote Docker host.
### `remote_docker_user`
Remote Docker user.
2021-12-25 23:47:30 +07:00
### `remote_docker_port`
Remote Docker ssh port ie (22).
### `ssh_private_key`
SSH private key used to connect to the docker host eg (~/.ssh/rsa_id).
2024-03-08 18:46:09 +08:00
### `ssh_proxy_cmd`
SSH ProxyCommand used to connect to the docker host.
2021-12-25 23:47:30 +07:00
### `args`
Deployment command args.
### `deploy_path`
2024-03-08 18:46:09 +08:00
The absolute path on remote docker host to deploy, default rely on repo working directory.
2021-12-25 23:47:30 +07:00
### `stack_file_name`
2024-03-08 18:46:09 +08:00
Compose configuration files.
### `env_file_name`
Specify an alternate environment file.
2021-12-25 23:47:30 +07:00
### `docker_prune`
A boolean input to trigger docker prune command. Default is false.
### `pre_deployment_command_args`
The args for the pre deploument command.
### `pull_images_first`
Pull docker images before deploying. Default is false.
### `docker_registry_username`
The docker registry username.
### `docker_registry_password`
The docker registry password.
### `docker_registry_uri`
The docker registry URI. Default is https://registry.hub.docker.com.