Skip to content

Commit b249617

Browse files
authored
feat(ci): deploy bindings server image to DockerHub (#1353)
Part of #1318.
1 parent 9631ec2 commit b249617

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

.github/workflows/bindings-server.main.kts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import java.net.http.HttpResponse.BodyHandlers
1919
import kotlin.time.Duration.Companion.minutes
2020
import kotlin.time.TimeSource
2121

22-
val GRADLE_ENCRYPTION_KEY by Contexts.secrets
22+
val DOCKERHUB_USERNAME by Contexts.secrets
23+
val DOCKERHUB_PASSWORD by Contexts.secrets
24+
val TRIGGER_IMAGE_PULL by Contexts.secrets
2325

2426
@OptIn(ExperimentalKotlinLogicStep::class)
2527
workflow(
@@ -81,10 +83,23 @@ workflow(
8183
runsOn = UbuntuLatest,
8284
`if` = expr { "${github.event_name} == 'push'" },
8385
needs = listOf(endToEndTest),
86+
env = linkedMapOf(
87+
"DOCKERHUB_USERNAME" to expr { DOCKERHUB_USERNAME },
88+
"DOCKERHUB_PASSWORD" to expr { DOCKERHUB_PASSWORD },
89+
),
8490
_customArguments = mapOf(
8591
"environment" to "DockerHub",
8692
)
8793
) {
88-
run(command = "echo TODO")
94+
uses(action = CheckoutV4())
95+
uses(action = ActionsSetupGradleV3())
96+
run(
97+
name = "Build and publish image",
98+
command = "./gradlew :jit-binding-server:publishImage",
99+
)
100+
run(
101+
name = "Use newest image on the server",
102+
command = "curl -X POST ${expr { TRIGGER_IMAGE_PULL }} --insecure",
103+
)
89104
}
90105
}.writeToFile()

.github/workflows/bindings-server.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,19 @@ jobs:
4949
needs:
5050
- 'end-to-end-test'
5151
- 'check_yaml_consistency'
52+
env:
53+
DOCKERHUB_USERNAME: '${{ secrets.DOCKERHUB_USERNAME }}'
54+
DOCKERHUB_PASSWORD: '${{ secrets.DOCKERHUB_PASSWORD }}'
5255
if: '${{ github.event_name == ''push'' }}'
5356
environment: 'DockerHub'
5457
steps:
5558
- id: 'step-0'
56-
run: 'echo TODO'
59+
uses: 'actions/checkout@v4'
60+
- id: 'step-1'
61+
uses: 'gradle/actions/setup-gradle@v3'
62+
- id: 'step-2'
63+
name: 'Build and publish image'
64+
run: './gradlew :jit-binding-server:publishImage'
65+
- id: 'step-3'
66+
name: 'Use newest image on the server'
67+
run: 'curl -X POST ${{ secrets.TRIGGER_IMAGE_PULL }} --insecure'

0 commit comments

Comments
 (0)