Skip to content

Conversation

@nevoodoo
Copy link
Contributor

@nevoodoo nevoodoo commented Nov 20, 2025

Summary

This PR implements Docker layer caching to significantly speed up CI builds for development branches while keeping production builds clean and reproducible.

Changes

  1. GitHub Workflow - Switched to docker/build-push-action
  • Replaced manual docker pull/build/push commands with docker/build-push-action
  • Uses GitHub Actions cache (type=gha) for fast layer caching
  • Development builds benefit from caching; production builds use no-cache: true
  • Security: Fixed code injection vulnerability by using environment variables instead of direct github.ref_name interpolation
  1. Dockerfile - Optimized for layer caching
  • Follows uv's official Docker pattern with bind mounts
  • Separates dependency installation from source code copying
  • Uses --locked flag (uv's recommended option for Docker)
  • Uses --no-dev to exclude development dependencies from production image
  • Combines GitHub Actions cache (layer reuse) with UV cache mount (package download caching)

@nevoodoo nevoodoo requested a review from a team as a code owner November 20, 2025 04:17
@cpg-software-ci-bot
Copy link
Contributor

cpg-software-ci-bot commented Nov 20, 2025

📊 SonarQube Summary

Metric This PR Main Branch
✅ Coverage 76.3% 76.3%
💨 Code Smells 47 13
🐞 Bugs 0 0
🔐 Vulnerabilities 0 0
🚨 Security Hotspots 1 0
📝 New Issues 0 0
🌟 Quality Gate ✅ OK ✅ OK

🔗 View Main Branch Report
🔗 View PR Report

@nevoodoo nevoodoo changed the title Test docker build with caching Add Docker layer caching for development builds Nov 20, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 20, 2025

🐳 Docker Image Built

A new Docker image has been built for this PR:

Image: australia-southeast1-docker.pkg.dev/cpg-common/images-dev/cpg_flow:5a9a021727776b58f3781c6128a0d2efb95a54a5

Pull command:

docker pull australia-southeast1-docker.pkg.dev/cpg-common/images-dev/cpg_flow:5a9a021727776b58f3781c6128a0d2efb95a54a5

🔗 View in Google Cloud Console


This comment was automatically generated by the Docker workflow.

@nevoodoo nevoodoo requested a review from jmarshall November 20, 2025 04:23
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.

3 participants