Add multi-architecture (amd64/arm64) container builds with GHCR support #41
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.
Summary
This PR adds automated multi-architecture Docker image builds (linux/amd64 and linux/arm64) with automatic publishing to GitHub Container Registry (GHCR).
What's included
.github/workflows/build-push.yml- Builds and pushes multi-arch images on every push tophp*branchesBenefits
🚫 No rate limiting
Unlike Docker Hub, GHCR has no anonymous pull rate limits. This is particularly valuable for CI/CD pipelines where Docker Hub's 100 pulls/6 hours limit can cause build failures during busy periods.
💰 Cost savings with ARM support
ARM64 instances (AWS Graviton, Azure Ampere, GCP Tau T2A) are typically 20-40% cheaper than equivalent x86 instances while offering comparable or better performance. Adding arm64 support enables the community to run LocalGov Drupal on these more cost-effective platforms.
🔄 Dynamic tagging
The workflow automatically extracts the base image tag from the Dockerfile, so when you update
FROM php:8.4-apache, it will automatically tag asphp-8.4-apache- no manual tag updates needed.📦 Works for upstream and forks
Uses
${{ github.repository }}so the same workflow works in the main repo and any forks without modification.Image locations
Once merged, images will be available at:
Adding Docker Hub publishing (optional)
If you'd also like to automatically push to Docker Hub alongside GHCR, you can add these steps to the workflow:
And update the
tagsin the build step:This would require adding
DOCKERHUB_USERNAMEandDOCKERHUB_TOKENsecrets to the repository.We've verified the workflow works - our fork's build completed successfully and the multi-arch image is functioning correctly:
We're happy to make any changes you'd suggest - please let us know if you have any feedback or would like us to adjust anything.