refactor: improve GitHub Actions workflow for container image builds#56
Merged
refactor: improve GitHub Actions workflow for container image builds#56
Conversation
Major improvements to the container build workflow: - Renamed workflow file from build-image.yaml to build-container-image.yaml for clarity - Switched from docker/build-push-action@v4 to docker/build-push-action@v6 for latest features - Added comprehensive Docker metadata generation using docker/metadata-action@v5 - Automatically generates semantic version tags (e.g., 1.2.3, 1.2, 1) - Creates 'latest' tag for main branch builds - Adds branch name tags for feature branches - Includes SHA-based tags for traceability - Generates proper OCI image labels - Enhanced security with attestation generation for supply chain verification - Improved caching strategy with GitHub Actions cache backend - Better structured workflow with clear separation of concerns These changes provide better versioning, improved security, and more maintainable CI/CD pipeline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 improves the GitHub Actions workflow for building container images with enhanced security, performance, and flexibility features.
Key Improvements
Security Enhancements
provenance: mode=maxand attestation generationPerformance Optimizations
type=ghacaching for faster buildslinux/amd64andlinux/arm64Better Tagging Strategy
v*tagsv1.0.0creates bothv1.0.0andlatest)YYYYMMDD-HHmmss-{sha}Metadata Improvements
docker/metadata-action@v4for intelligent tag generationWorkflow Enhancements
workflow_dispatchfor on-demand buildsbuild-image.yamltobuild-container-image.yamlfor clarityattestations: writepermission for artifact attestationsChanges Made
.github/workflows/build-image.yaml.github/workflows/build-container-image.yamlTesting
Security Impact
This PR significantly improves the security posture of our container builds by: