-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor Docker build workflow conditions #4
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
Conversation
Updated conditions for disk space cleanup and Docker image build platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors the Docker build workflow to simplify trigger conditions and expand build platform coverage. The changes shift from release-centric multi-platform builds to building for multiple architectures on all events except pull requests, which now only build for amd64 to speed up CI.
Key Changes
- Modified disk space cleanup to run on all events except pull requests (previously only on releases/tags)
- Inverted platform selection logic: pull requests now build only amd64, while all other events build both amd64 and arm64
- Enhanced disk cleanup with additional options (android, dotnet, haskell, large-packages, docker-images, swap-storage)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| - name: Free Disk Space (Ubuntu) | ||
| if: ${{ (github.event_name == 'release' && github.event.action == 'published') || github.ref_type == 'tag' }} | ||
| if: ${{ github.event_name != 'pull_request' }} |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disk space cleanup now runs for all non-pull-request events including regular pushes to branches. This may unnecessarily slow down routine development builds. Consider restricting this to events that actually need the extra space (e.g., releases or tags): if: ${{ github.ref_type == 'tag' || (github.event_name == 'release' && github.event.action == 'published') }}
| if: ${{ github.event_name != 'pull_request' }} | |
| if: ${{ github.ref_type == 'tag' || (github.event_name == 'release' && github.event.action == 'published') }} |
| sbom: ${{ github.event_name == 'release' && github.event.action == 'published' }} | ||
| # Build for multiple architectures: amd64 (x86_64) and arm64 (ARM 64-bit) on Linux | ||
| # Pull requests only build amd64 for faster CI | ||
| platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }} |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sbom generation step has been removed entirely. If SBOM (Software Bill of Materials) generation is still required for releases or security compliance, this line should be added back: sbom: ${{ github.event_name != 'pull_request' }}
| platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }} | |
| platforms: ${{ github.event_name == 'pull_request' && 'linux/amd64' || 'linux/amd64,linux/arm64' }} | |
| - name: Generate SBOM | |
| if: ${{ github.event_name != 'pull_request' }} | |
| uses: aquasecurity/trivy-action@v0.13.1 | |
| with: | |
| image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | |
| format: 'cyclonedx' | |
| output: 'sbom.json' |
Updated conditions for disk space cleanup and Docker image build platforms.