Skip to content
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

Make workflow Docker builds smarter: #11

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

vicnett
Copy link
Owner

@vicnett vicnett commented Nov 4, 2024

What

Various changes to the Docker build workflow:

  • Enable cache for faster builds
  • Build on push, not PR, but also:
  • Cancel ongoing builds when a new one is triggered (except on main)
  • Scheduled weekly builds on main

Why

I wanted to make the builds faster and make sure they don't re-download everything every time. Hopefully enabling the GitHub Actions Cache does both.

I also wanted to run builds once a week so that I would know if/when upstream updates break my stuff. I picked Friday afternoons because it feels like the best time: if there's something broken I'd rather it turn into a weekend project 😁

I also didn't like only building on pushes to main and PR activity, because it meant that branch builds wouldn't start until I was done typing up the PR description (or I'd have to open the PR first and then edit to add the description).

Instead, I'm back to building on every push, except now new builds should cancel existing ones if they haven't finished yet.

Testing

Builds take about half as long now (from ~2min to ~1min). I'd love to get this number down even lower but I'm not sure I can. At least not now...

- Enable cache for faster builds
- Build on push, not PR, but also:
- Cancel ongoing builds when a new one is triggered (except on main)
- Scheduled weekly builds on main
@vicnett vicnett merged commit bc40a62 into main Nov 4, 2024
1 check passed
@vicnett vicnett deleted the weekly-image-builds branch November 4, 2024 22:57
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.

1 participant