update readme and allow to copy .env file when needed

This commit is contained in:
Radosław Kukuczka
2025-05-20 00:27:37 +02:00
parent 6174611933
commit 90f83b775e
2 changed files with 49 additions and 13 deletions

View File

@@ -11,20 +11,26 @@ Robustly deploy your Docker Compose files to Docker Swarm or regular Docker Comp
- 🔍 **Remote validation of Docker Compose files**
- 🧹 **Automatic cleanup of temporary files**
- 📋 **Detailed debug logs for easy troubleshooting**
- 📂 **Optional copying of Docker build context**
- 📄 **Optional copying of `.env` files**
---
## 📥 Inputs
| Input | Description | Required | Default |
|--------------------|--------------------------------------------------|----------|---------|
| `stack_name` | Docker stack or compose project name | ✅ Yes | - |
| `ssh_host` | SSH host | ✅ Yes | - |
| `ssh_user` | SSH username | ✅ Yes | - |
| `ssh_key` | SSH private key | ✅ Yes | - |
| `deploy_file` | Path to the processed deployment file | ✅ Yes | - |
| `deploy_mode` | Deployment mode: `swarm` or `compose` | ❌ No | `swarm` |
| `remote_temp_dir` | Remote temporary directory for deployment files | ❌ No | `/tmp` |
| Input | Description | Required | Default |
|-----------------------|----------------------------------------------------------------|----------|------------------|
| `stack_name` | Docker stack or compose project name | ✅ Yes | - |
| `ssh_host` | SSH host | ✅ Yes | - |
| `ssh_user` | SSH username | ✅ Yes | - |
| `ssh_key` | SSH private key | ✅ Yes | - |
| `deploy_file` | Path to the processed deployment file | ✅ Yes | - |
| `deploy_mode` | Deployment mode: `swarm` or `compose` | ❌ No | `swarm` |
| `remote_temp_dir` | Remote temporary directory for deployment files | ❌ No | `/tmp` |
| `copy_build_context` | Whether to copy Docker build context to remote host | ❌ No | `false` |
| `build_context_path` | Local path to Docker build context | ❌ No | `build-context` |
| `copy_env_file` | Whether to copy `.env` file to remote host | ❌ No | `false` |
| `env_file_path` | Local path to `.env` file | ❌ No | `.env` |
---
@@ -56,7 +62,7 @@ This action supports two deployment modes:
deploy_mode: swarm
```
### Deploying with Docker Compose 🐳
### Deploying with Docker Compose 🐳 (including build context and `.env` file)
```yaml
- name: Deploy using Docker Compose 🐳
@@ -68,6 +74,10 @@ This action supports two deployment modes:
ssh_key: ${{ secrets.SSH_KEY }}
deploy_file: docker-compose.processed.yml
deploy_mode: compose
copy_build_context: true
build_context_path: ./docker-context
copy_env_file: true
env_file_path: ./production.env
```
---
@@ -79,9 +89,11 @@ This action performs the following steps:
1. 🔑 **Securely creates a temporary SSH key file** for authentication.
2. 📁 **Creates a secure temporary directory** on the remote host.
3. 📤 **Copies your processed Docker Compose file** to the remote host.
4. 🔍 **Validates the Docker Compose file remotely** to ensure correctness.
5. 🚢🐳 **Deploys your stack/project** based on the selected deployment mode.
6. 🧹 **Cleans up temporary files** both locally and remotely.
4. 📂 **Optionally copies Docker build context** to the remote host.
5. 📄 **Optionally copies `.env` file** to the remote host.
6. 🔍 **Validates the Docker Compose file remotely** to ensure correctness.
7. 🚢🐳 **Deploys your stack/project** based on the selected deployment mode.
8. 🧹 **Cleans up temporary files** both locally and remotely.
---