Skip to content

Conversation

@ludalex
Copy link

@ludalex ludalex commented Jun 4, 2025

This PR adds support for two new Docker deployment options that enhance the flexibility of container deployments with Heroku:

  • docker_context_path - Allows specifying a custom build context path
  • docker_find_recursive - Enables deployment of multiple Docker containers from subdirectories

Changes Made

🔧 Core Implementation

  • action.yml: Added two new input parameters with proper descriptions and defaults
  • index.js:
    • Added input parameter parsing for the new options
    • Updated deploy() function to accept and use the new parameters
    • Modified heroku container:push command to include --context-path and --recursive flags
    • Implemented proper flag handling and command construction

📚 Documentation

  • README.md:
    • Added new options to the options table with descriptions and examples
    • Created two new example sections:
      • "Deploy with Docker Context Path" - demonstrates custom build context usage
      • "Deploy with Multiple Docker Processes (Recursive)" - shows multi-container deployment
    • Added reference to Heroku Container Registry documentation

New Features

docker_context_path

  • Purpose: Specify a custom build context path (defaults to Dockerfile directory)
  • Use Case: When Dockerfile is not in root or you need specific directory structure
  • Example: docker_context_path: "." (if you have a monorepo, for instance)

docker_find_recursive

  • Purpose: Deploy multiple containers using Dockerfile.<process> files from current and subdirectories
  • Use Case: Monorepo setups or applications with multiple services
  • Example: Looks for Dockerfile.web, Dockerfile.worker, etc.

Usage Examples

# Using docker_context_path
- uses: akhileshns/[email protected]
  with:
    heroku_api_key: ${{secrets.HEROKU_API_KEY}}
    heroku_app_name: "my-app"
    heroku_email: "[email protected]"
    usedocker: true
    docker_context_path: "."

# Using docker_find_recursive
- uses: akhileshns/[email protected]
  with:
    heroku_api_key: ${{secrets.HEROKU_API_KEY}}
    heroku_app_name: "my-app"
    heroku_email: "[email protected]"
    usedocker: true
    docker_find_recursive: true
    docker_heroku_process_type: "web worker"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant