Skip to content

Commit

Permalink
up: Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
tristiisch committed Feb 27, 2024
1 parent af8fdc7 commit c2921cd
Showing 1 changed file with 38 additions and 29 deletions.
67 changes: 38 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Docker Deployment Action

A [GitHub Action](https://github.com/marketplace/actions/docker-stack-deployment) that supports docker-compose and Docker Swarm deployments.
# Docker Stack Deployment Action

Docker Stack Deployment Action is a versatile tool designed for effortless docker-compose and Docker Swarm deployments within GitHub Actions workflows.

## Example

Below is a brief example on how the action can be used:
Below is a concise example demonstrating the utilization of this action:

```yaml
- name: Deploy to Docker
Expand All @@ -19,66 +18,76 @@ Below is a brief example on how the action can be used:
deploy_path: /root/my-deployment
stack_file_name: docker-compose.yaml
keep_files: 5
args: my_applicaion
args: my_application
```
## Input Configurations
Below are all of the supported inputs. Some inputs are considered sensitive information and it should be stored as secrets.
Below is a comprehensive list of all supported inputs. Certain inputs are sensitive and should be stored as secrets.
### `args`

Arguments to pass to the deployment command either `docker` or `docker-compose`. The actions will automatically generate the follwing commands for each of the cases.

Specify arguments to pass to the deployment command, either `docker` or `docker-compose`. The action automatically generates the following commands for each case:
- `docker stack deploy --compose-file $FILE --log-level debug --host $HOST`
- `docker-compose -f $INPUT_STACK_FILE_NAME`


### `remote_docker_host`

Specify Remote Docker host. The input value must be in the follwing format (user@host)
Specify the Remote Docker host in the format `user@host`.

### `remote_docker_port`

Specify Remote Docker ssh port if its not 22 default ie (2222)
Specify the Remote Docker SSH port if it's not the default (22), e.g., (2222).

### `ssh_public_key`

Remote Docker SSH public key.

Do not give the content of `id_rsa.pub`

The content of `~/.ssh/known_hosts` needs to be given here. You can get it by connecting to host once using your own machine. Example:
Provide the SSH public key for the Remote Docker. Do not provide the content of `id_rsa.pub`. Instead, provide the content of `~/.ssh/known_hosts`, obtainable by connecting to the host once using your machine.

Example:
```
1.1.1.1 ecdsa-sha2-nistp256 AAAAE2VjZHNhLNTYAAAAIbmlzdHAyNCN5F3TLxUllpSRx8y+9C2uh+lWZDFmAsFMjcz2Zgq4d5F+oGicGaRk=
```

### `ssh_private_key`

SSH private key used to connect to the docker host
Provide the SSH private key used to connect to the Docker host. Ensure the SSH key is in PEM format (begins with -----BEGIN RSA PRIVATE KEY-----), or you may encounter an "invalid format" error. Convert it from OPENSSH format (beginning with -----BEGIN OPENSSH PRIVATE KEY-----) using `ssh-keygen -p -m PEM -f ~/.ssh/id_rsa`.

SSH key must be in PEM format (begins with -----BEGIN RSA PRIVATE KEY-----), or you can randomly get _Load key "/HOME/.ssh/id_rsa": invalid format_ error.
### `deployment_mode`

Convert it from OPENSSH (key begins with -----BEGIN OPENSSH PRIVATE KEY-----) format using `ssh-keygen -p -m PEM -f ~/.ssh/id_rsa`
Specify the deployment mode as either docker-swarm or docker-compose. The default is docker-compose.

### `deployment_mode`
Deployment mode either docker-swarm or docker-compose. Default is docker-compose.
### `copy_stack_file`
Copy stack file to remote server and deploy from the server. Default is false.

Toggle to copy the stack file to the remote server and deploy from there. Default is false.

### `deploy_path`
The path where the stack files will be copied to. Default ~/docker-deployment.

Specify the path where the stack files will be copied. Default is ~/docker-deployment.

### `stack_file_name`
Docker stack file used. Default is docker-compose.yaml

Specify the Docker stack file to be used. Default is docker-compose.yaml.

### `keep_files`
Number of the files to be kept on the server. Default is 3.

Specify the number of files to be retained on the server. Default is 3.

### `docker_prune`
A boolean input to trigger docker prune command.

A boolean input to trigger the docker prune command.

### `pre_deployment_command_args`
The args for the pre deploument command. Applicable only for docker-compose.

Specify the arguments for the pre-deployment command. Applicable only for docker-compose.

### `pull_images_first`
Pull docker images before deploying. Applicable only for docker-compose.

Toggle to pull Docker images before deploying. Applicable only for docker-compose.

### `debug`

Enable verbose messages for debugging purposes.

## License

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for details.

0 comments on commit c2921cd

Please sign in to comment.