Skip to content

Commit f25ff0a

Browse files
committed
ci: publish docker image on release
1 parent 50e1601 commit f25ff0a

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

.github/workflows/publish-release.yml

+7
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
release:
55
types: [published]
66

7+
env:
8+
IMAGE_BASE_NAME: docker.pkg.github.com/${{ github.repository }}/${{ github.repository }}
9+
710
jobs:
811
publish-release:
912
runs-on: ubuntu-latest
@@ -35,3 +38,7 @@ jobs:
3538
echo "New version: ${NEW_VERSION}"
3639
echo "Github username: ${GITHUB_ACTOR}"
3740
./gradlew -Pversion=${NEW_VERSION} publish
41+
./gradlew jibDockerBuild --image="${IMAGE_BASE_NAME}:${NEW_VERSION}"
42+
echo "$GITHUB_TOKEN" | docker login --username "$GITHUB_REPOSITORY" --password-stdin https://docker.pkg.github.com
43+
docker push "${IMAGE_BASE_NAME}:${NEW_VERSION}"
44+

build.gradle.kts

+6-12
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,6 @@ publishing {
9797
developerConnection.set("scm:git:ssh://github.com/navikt/${rootProject.name}.git")
9898
url.set("https://github.com/navikt/${rootProject.name}")
9999
}
100-
withXml {
101-
//dependencies.
102-
/*asNode().dependencies.'*'.findAll() {
103-
it.scope.text() == 'runtime' && project.configurations.compile.allDependencies.find { dep ->
104-
dep.name == it.artifactId.text()
105-
}
106-
}.each() {
107-
it.scope*.value = 'compile'
108-
}*/
109-
}
110100
}
111101
}
112102
}
@@ -173,11 +163,15 @@ tasks {
173163
useJUnitPlatform()
174164
}
175165

176-
"build" {
166+
"jibDockerBuild" {
167+
dependsOn("shadowJar")
168+
}
169+
/*
170+
"publish" {
177171
dependsOn("shadowJar")
178172
dependsOn("jibDockerBuild")
179173
}
180-
174+
*/
181175
withType<Sign>().configureEach {
182176
onlyIf { !version.toString().endsWith("SNAPSHOT") }
183177
}

0 commit comments

Comments
 (0)