Clear docker cache after building in CI

We're at the CI storage limits, so hopefully this helps.
This commit is contained in:
Luke Parker
2023-07-25 21:09:36 -04:00
parent 61d46dccd4
commit 4949793c3f
4 changed files with 20 additions and 6 deletions

View File

@@ -143,6 +143,20 @@ pub fn build(name: String) {
println!("Built!");
if std::env::var("GITHUB_CI").is_ok() {
println!("In CI, so clearing cache to prevent hitting the storage limits.");
Command::new("docker")
.arg("builder")
.arg("prune")
.arg("--all")
.arg("--force")
.output()
.unwrap();
if !res.status.success() {
println!("failed to clear cache after building {name}\n");
}
}
// Set built
built_lock.insert(name, true);
}