Skip to content

Add Docker Context Path and Recursive Options Support #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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