Skip to content

Commit 98aad2d

Browse files
authored
Publish a latest-snapshot docker image from main (#586)
1 parent b1386d2 commit 98aad2d

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

.github/workflows/release-docker.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Release Docker
22
on:
33
push:
4+
branches:
5+
- main
46
tags: ["*"]
57
jobs:
68
publish:

build.sbt

+22-5
Original file line numberDiff line numberDiff line change
@@ -272,11 +272,28 @@ lazy val cli = project
272272
propsFile :: copiedJars.toList
273273
}
274274
.taskValue,
275-
docker / imageNames :=
276-
List(
277-
ImageName("sourcegraph/scip-java:latest"),
278-
ImageName(s"sourcegraph/scip-java:${version.value}")
279-
),
275+
docker / imageNames := {
276+
val latest = {
277+
val label =
278+
if (isSnapshot.value)
279+
"latest-snapshot"
280+
else
281+
"latest"
282+
283+
List(ImageName(s"sourcegraph/scip-java:$label"))
284+
}
285+
286+
// Don't publish a separately tagged image for snapshots -
287+
// only latest-snapshot
288+
val versioned =
289+
if (isSnapshot.value)
290+
Nil
291+
else
292+
List(ImageName(s"sourcegraph/scip-java:${version.value}"))
293+
294+
latest ++ versioned
295+
296+
},
280297
docker / dockerfile := {
281298
val binaryDistribution = pack.value
282299
val scipJavaWrapper = (ThisBuild / baseDirectory).value / "bin" /

0 commit comments

Comments
 (0)