Add flexible Docker registry strategy support with separate workflows #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements a flexible multi-registry approach for Docker image publishing, allowing users to choose between GitHub Container Registry (GHCR), Docker Hub, both, or neither based on available secrets and project needs.
New Architecture
Instead of modifying the existing docker-build-push action, this creates separate composite actions for different registry scenarios:
docker-build-push-ghcr- GitHub Container Registry only (no Docker secrets needed)docker-build-push-dockerhub- Docker Hub only (requires Docker credentials)docker-build-push-dual- Both registries (requires Docker credentials)docker-build-push-smart- Auto-detection based on available secretsSmart Strategy Selection
The main
docker-build-and-push.ymlworkflow now supports aregistry-strategyinput:Available Strategies:
auto(default) - Automatically chooses based on available secretsghcr- GHCR only, uses GitHub token automaticallydockerhub- Docker Hub only, requires Docker credentialsdual- Both registries, requires Docker credentialslegacy- Original behavior for backward compatibilitynone- Build only, no pushTag Generation Examples
The system intelligently handles tag conversion:
Migration Benefits
Helm Workflow Updates
Updated
helm-chart-deploy.ymlto useghcr.io/webgrip/helm-deploy:latestwith GitHub token authentication, removing dependency on Docker Hub credentials for container access.Documentation
Comprehensive documentation and examples provided:
DOCKER_REGISTRY_GUIDE.md- Complete usage guide and migration instructionsdocker-registry-strategy-examples.yml- Working examples of all strategiesFixes #3 with a more flexible, user-controlled approach.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.