diff --git a/crates/cuddle-ci/src/rust_service.rs b/crates/cuddle-ci/src/rust_service.rs index b659aef..76c18b9 100644 --- a/crates/cuddle-ci/src/rust_service.rs +++ b/crates/cuddle-ci/src/rust_service.rs @@ -327,9 +327,23 @@ impl RustService { #[async_trait] impl PullRequestAction for RustService { - async fn execute_pull_request(&self, _ctx: &mut Context) -> eyre::Result<()> { + async fn execute_pull_request(&self, ctx: &mut Context) -> eyre::Result<()> { self.build_test().await?; + let container = self.build_release().await?.pipeline("pr"); + let timestamp = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_secs(); + + let tag = format!( + "docker.io/kasperhermansen/{}:dev-{}", + self.bin_name, timestamp, + ); + + container.publish(&tag).await?; + ctx.set_image_tag(format!("dev-{}", ×tamp.to_string()))?; + Ok(()) } }