github.com/kubeshop/testkube@v1.17.23/.github/workflows/docker-build-release.yaml (about) 1 name: Docker images build release 2 on: 3 workflow_dispatch: 4 push: 5 branches: 6 - release/** 7 paths-ignore: 8 - 'docs/**' 9 env: 10 ALPINE_IMAGE: alpine:3.19.0 11 BUSYBOX_IMAGE: busybox:1.36.1-musl 12 GO_VERSION: 1.21.5 13 14 jobs: 15 api: 16 runs-on: ubuntu-latest 17 steps: 18 - name: Checkout 19 uses: actions/checkout@v4 20 21 - name: Set up Docker Buildx 22 id: buildx 23 uses: docker/setup-buildx-action@v1 24 25 - name: Set-up Go 26 uses: actions/setup-go@v4 27 with: 28 go-version: ${{ env.GO_VERSION }} 29 cache: false 30 31 - name: Go Cache 32 uses: actions/cache@v2 33 with: 34 path: | 35 ~/go/pkg/mod 36 ~/.cache/go-build 37 key: testkube-api-go-${{ hashFiles('**/go.sum') }} 38 39 - name: Login to DockerHub 40 uses: docker/login-action@v1 41 with: 42 username: ${{ secrets.DOCKERHUB_USERNAME }} 43 password: ${{ secrets.DOCKERHUB_TOKEN }} 44 45 - id: commit 46 uses: prompt/actions-commit-hash@v3 47 48 - name: Release 49 uses: goreleaser/goreleaser-action@v4 50 with: 51 distribution: goreleaser 52 version: latest 53 args: release -f goreleaser_files/.goreleaser-docker-build-api.yml --snapshot 54 env: 55 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 56 ANALYTICS_TRACKING_ID: ${{secrets.TESTKUBE_API_GA_MEASUREMENT_ID}} 57 ANALYTICS_API_KEY: ${{secrets.TESTKUBE_API_GA_MEASUREMENT_SECRET}} 58 SLACK_BOT_CLIENT_ID: ${{secrets.TESTKUBE_SLACK_BOT_CLIENT_ID}} 59 SLACK_BOT_CLIENT_SECRET: ${{secrets.TESTKUBE_SLACK_BOT_CLIENT_SECRET}} 60 SEGMENTIO_KEY: ${{secrets.TESTKUBE_API_SEGMENTIO_KEY}} 61 CLOUD_SEGMENTIO_KEY: ${{secrets.TESTKUBE_API_CLOUD_SEGMENTIO_KEY}} 62 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 63 DOCKER_BUILDX_CACHE_FROM: "type=gha" 64 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 65 ALPINE_IMAGE: ${{ env.ALPINE_IMAGE }} 66 BUSYBOX_IMAGE: ${{ env.BUSYBOX_IMAGE }} 67 IMAGE_TAG_SHA: true 68 69 - name: Push Docker images 70 run: | 71 docker push kubeshop/testkube-api-server:${{ steps.commit.outputs.short }} 72 73 testworkflow-init: 74 runs-on: ubuntu-latest 75 steps: 76 - name: Checkout 77 uses: actions/checkout@v4 78 79 - name: Set up Docker Buildx 80 id: buildx 81 uses: docker/setup-buildx-action@v1 82 83 - name: Set-up Go 84 uses: actions/setup-go@v4 85 with: 86 go-version: ${{ env.GO_VERSION }} 87 cache: false 88 89 - name: Go Cache 90 uses: actions/cache@v2 91 with: 92 path: | 93 ~/go/pkg/mod 94 ~/.cache/go-build 95 key: testkube-tw-init-go-${{ hashFiles('**/go.sum') }} 96 97 - name: Login to DockerHub 98 uses: docker/login-action@v1 99 with: 100 username: ${{ secrets.DOCKERHUB_USERNAME }} 101 password: ${{ secrets.DOCKERHUB_TOKEN }} 102 103 - id: commit 104 uses: prompt/actions-commit-hash@v3 105 106 - name: Release 107 uses: goreleaser/goreleaser-action@v4 108 with: 109 distribution: goreleaser 110 version: latest 111 args: release -f goreleaser_files/.goreleaser-docker-build-testworkflow-init.yml --snapshot 112 env: 113 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 114 ANALYTICS_TRACKING_ID: ${{secrets.TESTKUBE_API_GA_MEASUREMENT_ID}} 115 ANALYTICS_API_KEY: ${{secrets.TESTKUBE_API_GA_MEASUREMENT_SECRET}} 116 SLACK_BOT_CLIENT_ID: ${{secrets.TESTKUBE_SLACK_BOT_CLIENT_ID}} 117 SLACK_BOT_CLIENT_SECRET: ${{secrets.TESTKUBE_SLACK_BOT_CLIENT_SECRET}} 118 SEGMENTIO_KEY: ${{secrets.TESTKUBE_API_SEGMENTIO_KEY}} 119 CLOUD_SEGMENTIO_KEY: ${{secrets.TESTKUBE_API_CLOUD_SEGMENTIO_KEY}} 120 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 121 DOCKER_BUILDX_CACHE_FROM: "type=gha" 122 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 123 ALPINE_IMAGE: ${{ env.ALPINE_IMAGE }} 124 BUSYBOX_IMAGE: ${{ env.BUSYBOX_IMAGE }} 125 IMAGE_TAG_SHA: true 126 127 - name: Push Docker images 128 run: | 129 docker push kubeshop/testkube-tw-init:${{ steps.commit.outputs.short }} 130 131 testworkflow-toolkit: 132 runs-on: ubuntu-latest 133 steps: 134 - name: Checkout 135 uses: actions/checkout@v4 136 137 - name: Set up Docker Buildx 138 id: buildx 139 uses: docker/setup-buildx-action@v1 140 141 - name: Set-up Go 142 uses: actions/setup-go@v4 143 with: 144 go-version: ${{ env.GO_VERSION }} 145 cache: false 146 147 - name: Go Cache 148 uses: actions/cache@v2 149 with: 150 path: | 151 ~/go/pkg/mod 152 ~/.cache/go-build 153 key: testkube-tw-toolkit-go-${{ hashFiles('**/go.sum') }} 154 155 - name: Login to DockerHub 156 uses: docker/login-action@v1 157 with: 158 username: ${{ secrets.DOCKERHUB_USERNAME }} 159 password: ${{ secrets.DOCKERHUB_TOKEN }} 160 161 - id: commit 162 uses: prompt/actions-commit-hash@v3 163 164 - name: Release 165 uses: goreleaser/goreleaser-action@v4 166 with: 167 distribution: goreleaser 168 version: latest 169 args: release -f goreleaser_files/.goreleaser-docker-build-testworkflow-toolkit.yml --snapshot 170 env: 171 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 172 ANALYTICS_TRACKING_ID: ${{secrets.TESTKUBE_API_GA_MEASUREMENT_ID}} 173 ANALYTICS_API_KEY: ${{secrets.TESTKUBE_API_GA_MEASUREMENT_SECRET}} 174 SLACK_BOT_CLIENT_ID: ${{secrets.TESTKUBE_SLACK_BOT_CLIENT_ID}} 175 SLACK_BOT_CLIENT_SECRET: ${{secrets.TESTKUBE_SLACK_BOT_CLIENT_SECRET}} 176 SEGMENTIO_KEY: ${{secrets.TESTKUBE_API_SEGMENTIO_KEY}} 177 CLOUD_SEGMENTIO_KEY: ${{secrets.TESTKUBE_API_CLOUD_SEGMENTIO_KEY}} 178 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 179 DOCKER_BUILDX_CACHE_FROM: "type=gha" 180 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 181 ALPINE_IMAGE: ${{ env.ALPINE_IMAGE }} 182 BUSYBOX_IMAGE: ${{ env.BUSYBOX_IMAGE }} 183 IMAGE_TAG_SHA: true 184 185 - name: Push Docker images 186 run: | 187 docker push kubeshop/testkube-tw-toolkit:${{ steps.commit.outputs.short }} 188 189 single_executor: 190 strategy: 191 matrix: 192 executor: [artillery, curl, example, ginkgo, k6, kubepug, postman, soapui, init, scraper, template, tracetest, zap ] 193 194 runs-on: ubuntu-latest 195 steps: 196 - name: Checkout 197 uses: actions/checkout@v4 198 199 - name: Set up Docker Buildx 200 id: buildx 201 uses: docker/setup-buildx-action@v1 202 203 - name: Set-up Go 204 uses: actions/setup-go@v4 205 with: 206 go-version: ${{ env.GO_VERSION }} 207 cache: false 208 209 - name: Go Cache 210 uses: actions/cache@v2 211 with: 212 path: | 213 ~/go/pkg/mod 214 ~/.cache/go-build 215 key: ${{ matrix.executor }}-go-${{ hashFiles('**/go.sum') }} 216 restore-keys: | 217 ${{ runner.os }}-go- 218 219 - id: commit 220 uses: prompt/actions-commit-hash@v3 221 222 - name: Login to DockerHub 223 uses: docker/login-action@v1 224 with: 225 username: ${{ secrets.DOCKERHUB_USERNAME }} 226 password: ${{ secrets.DOCKERHUB_TOKEN }} 227 228 - name: Release 229 uses: goreleaser/goreleaser-action@v4 230 with: 231 distribution: goreleaser 232 version: latest 233 args: release -f goreleaser_files/.goreleaser-docker-build-executor.yml --snapshot 234 env: 235 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 236 EXECUTOR: ${{ matrix.executor }} 237 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 238 DOCKER_BUILDX_CACHE_FROM: "type=gha" 239 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 240 ALPINE_IMAGE: ${{ env.ALPINE_IMAGE }} 241 BUSYBOX_IMAGE: ${{ env.BUSYBOX_IMAGE }} 242 IMAGE_TAG_SHA: true 243 244 - name: Push Docker images 245 run: | 246 docker push kubeshop/testkube-${{ matrix.executor }}-executor:${{ steps.commit.outputs.short }} 247 248 executor_jmeter: 249 runs-on: ubuntu-latest 250 steps: 251 252 - name: Checkout 253 uses: actions/checkout@v4 254 255 - name: Set up Docker Buildx 256 id: buildx 257 uses: docker/setup-buildx-action@v1 258 259 - name: Set-up Go 260 uses: actions/setup-go@v4 261 with: 262 go-version: ${{ env.GO_VERSION }} 263 cache: false 264 265 - name: Go Cache 266 uses: actions/cache@v2 267 with: 268 path: | 269 ~/go/pkg/mod 270 ~/.cache/go-build 271 key: jmeter-go-${{ hashFiles('**/go.sum') }} 272 restore-keys: | 273 ${{ runner.os }}-go- 274 275 - name: Login to DockerHub 276 uses: docker/login-action@v1 277 with: 278 username: ${{ secrets.DOCKERHUB_USERNAME }} 279 password: ${{ secrets.DOCKERHUB_TOKEN }} 280 281 - id: commit 282 uses: prompt/actions-commit-hash@v3 283 284 - name: Release 285 uses: goreleaser/goreleaser-action@v4 286 with: 287 distribution: goreleaser 288 version: latest 289 args: release -f goreleaser_files/.goreleaser-docker-build-executor-jmeter.yml --snapshot 290 env: 291 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 292 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 293 DOCKER_BUILDX_CACHE_FROM: "type=gha" 294 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 295 IMAGE_TAG_SHA: true 296 297 - name: Push Docker images 298 run: | 299 docker push kubeshop/testkube-jmeter-executor:${{ steps.commit.outputs.short }} 300 301 executor_jmeterd: 302 runs-on: ubuntu-latest 303 steps: 304 - name: Checkout 305 uses: actions/checkout@v2 306 307 - name: Set up Docker Buildx 308 id: buildx 309 uses: docker/setup-buildx-action@v1 310 311 - name: Set-up Go 312 uses: actions/setup-go@v4 313 with: 314 go-version: ${{ env.GO_VERSION }} 315 cache: false 316 317 - name: Go Cache 318 uses: actions/cache@v2 319 with: 320 path: | 321 ~/go/pkg/mod 322 ~/.cache/go-build 323 key: jmeterd-go-${{ hashFiles('**/go.sum') }} 324 restore-keys: | 325 ${{ runner.os }}-go- 326 327 - name: Login to DockerHub 328 uses: docker/login-action@v1 329 with: 330 username: ${{ secrets.DOCKERHUB_USERNAME }} 331 password: ${{ secrets.DOCKERHUB_TOKEN }} 332 333 - id: commit 334 uses: prompt/actions-commit-hash@v3 335 336 - name: Release 337 uses: goreleaser/goreleaser-action@v4 338 with: 339 distribution: goreleaser 340 version: latest 341 args: release -f goreleaser_files/.goreleaser-docker-build-executor-jmeterd.yml --clean --snapshot 342 env: 343 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 344 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 345 DOCKER_BUILDX_CACHE_FROM: "type=gha" 346 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 347 IMAGE_TAG_SHA: true 348 349 - name: Push Docker images 350 run: | 351 docker push kubeshop/testkube-jmeterd-executor:${{ steps.commit.outputs.short }} 352 353 jmeterd_slave: 354 runs-on: ubuntu-latest 355 steps: 356 - name: Checkout 357 uses: actions/checkout@v4 358 359 - name: Set up Docker Buildx 360 id: buildx 361 uses: docker/setup-buildx-action@v1 362 363 - name: Docker Cache 364 uses: actions/cache@v2 365 with: 366 path: /tmp/.buildx-cache 367 key: ${{ runner.os }}-buildx-${{ github.sha }} 368 restore-keys: | 369 ${{ runner.os }}-buildx- 370 371 - id: commit 372 uses: prompt/actions-commit-hash@v3 373 374 - name: Login to DockerHub 375 uses: docker/login-action@v1 376 with: 377 username: ${{ secrets.DOCKERHUB_USERNAME }} 378 password: ${{ secrets.DOCKERHUB_TOKEN }} 379 380 - name: Build and push 381 uses: docker/build-push-action@v5 382 with: 383 context: . 384 file: ./contrib/executor/jmeterd/build/slaves/Dockerfile 385 push: true 386 tags: kubeshop/testkube-jmeterd-slave:${{ steps.commit.outputs.short }} 387 platforms: linux/amd64,linux/arm64 388 389 executor_maven: 390 runs-on: ubuntu-latest 391 steps: 392 - name: Checkout 393 uses: actions/checkout@v4 394 395 - name: Set up Docker Buildx 396 id: buildx 397 uses: docker/setup-buildx-action@v1 398 399 - name: Set-up Go 400 uses: actions/setup-go@v4 401 with: 402 go-version: ${{ env.GO_VERSION }} 403 cache: false 404 405 - name: Go Cache 406 uses: actions/cache@v2 407 with: 408 path: | 409 ~/go/pkg/mod 410 ~/.cache/go-build 411 key: maven-go-${{ hashFiles('**/go.sum') }} 412 restore-keys: | 413 ${{ runner.os }}-go- 414 415 - name: Login to DockerHub 416 uses: docker/login-action@v1 417 with: 418 username: ${{ secrets.DOCKERHUB_USERNAME }} 419 password: ${{ secrets.DOCKERHUB_TOKEN }} 420 421 - id: commit 422 uses: prompt/actions-commit-hash@v3 423 424 - name: Release 425 uses: goreleaser/goreleaser-action@v4 426 with: 427 distribution: goreleaser 428 version: latest 429 args: release -f goreleaser_files/.goreleaser-docker-build-executor-maven.yml --snapshot 430 env: 431 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 432 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 433 DOCKER_BUILDX_CACHE_FROM: "type=gha" 434 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 435 IMAGE_TAG_SHA: true 436 437 - name: Push Docker images 438 run: | 439 docker push kubeshop/testkube-maven-executor:${{ steps.commit.outputs.short }} 440 441 executor_gradle: 442 runs-on: ubuntu-latest 443 steps: 444 - name: Checkout 445 uses: actions/checkout@v4 446 447 - name: Set up Docker Buildx 448 id: buildx 449 uses: docker/setup-buildx-action@v1 450 451 - name: Set-up Go 452 uses: actions/setup-go@v4 453 with: 454 go-version: ${{ env.GO_VERSION }} 455 cache: false 456 457 - name: Go Cache 458 uses: actions/cache@v2 459 with: 460 path: | 461 ~/go/pkg/mod 462 ~/.cache/go-build 463 key: gradle-go-${{ hashFiles('**/go.sum') }} 464 restore-keys: | 465 ${{ runner.os }}-go- 466 467 - name: Login to DockerHub 468 uses: docker/login-action@v1 469 with: 470 username: ${{ secrets.DOCKERHUB_USERNAME }} 471 password: ${{ secrets.DOCKERHUB_TOKEN }} 472 473 - id: commit 474 uses: prompt/actions-commit-hash@v3 475 476 - name: Release 477 uses: goreleaser/goreleaser-action@v4 478 with: 479 distribution: goreleaser 480 version: latest 481 args: release -f goreleaser_files/.goreleaser-docker-build-executor-gradle.yml --snapshot 482 env: 483 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 484 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 485 DOCKER_BUILDX_CACHE_FROM: "type=gha" 486 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 487 IMAGE_TAG_SHA: true 488 489 - name: Push Docker images 490 run: | 491 docker push kubeshop/testkube-gradle-executor:${{ steps.commit.outputs.short }} 492 493 executor_cypress: 494 runs-on: ubuntu-latest 495 steps: 496 - name: Checkout 497 uses: actions/checkout@v4 498 499 - name: Set up Docker Buildx 500 id: buildx 501 uses: docker/setup-buildx-action@v1 502 503 - name: Set-up Go 504 uses: actions/setup-go@v4 505 with: 506 go-version: ${{ env.GO_VERSION }} 507 cache: false 508 509 - name: Go Cache 510 uses: actions/cache@v2 511 with: 512 path: | 513 ~/go/pkg/mod 514 ~/.cache/go-build 515 key: cypress-go-${{ hashFiles('**/go.sum') }} 516 restore-keys: | 517 ${{ runner.os }}-go- 518 519 - name: Login to DockerHub 520 uses: docker/login-action@v1 521 with: 522 username: ${{ secrets.DOCKERHUB_USERNAME }} 523 password: ${{ secrets.DOCKERHUB_TOKEN }} 524 525 - id: commit 526 uses: prompt/actions-commit-hash@v3 527 528 - name: Release 529 uses: goreleaser/goreleaser-action@v4 530 with: 531 distribution: goreleaser 532 version: latest 533 args: release -f goreleaser_files/.goreleaser-docker-build-executor-cypress-commit-only.yml --snapshot 534 env: 535 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 536 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 537 DOCKER_BUILDX_CACHE_FROM: "type=gha" 538 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 539 540 - name: Push image to the Registry 541 run: | 542 docker push kubeshop/testkube-cypress-executor:${{ steps.commit.outputs.short }} 543 544 executor_playwright: 545 runs-on: ubuntu-latest 546 steps: 547 - name: Checkout 548 uses: actions/checkout@v4 549 550 - name: Set up Docker Buildx 551 id: buildx 552 uses: docker/setup-buildx-action@v1 553 554 - name: Set-up Go 555 uses: actions/setup-go@v4 556 with: 557 go-version: ${{ env.GO_VERSION }} 558 cache: false 559 560 - name: Go Cache 561 uses: actions/cache@v2 562 with: 563 path: | 564 ~/go/pkg/mod 565 ~/.cache/go-build 566 key: playwright-go-${{ hashFiles('**/go.sum') }} 567 restore-keys: | 568 ${{ runner.os }}-go- 569 570 - name: Login to DockerHub 571 uses: docker/login-action@v1 572 with: 573 username: ${{ secrets.DOCKERHUB_USERNAME }} 574 password: ${{ secrets.DOCKERHUB_TOKEN }} 575 576 - id: commit 577 uses: prompt/actions-commit-hash@v3 578 579 - name: Release 580 uses: goreleaser/goreleaser-action@v4 581 with: 582 distribution: goreleaser 583 version: latest 584 args: release -f goreleaser_files/.goreleaser-docker-build-executor-playwright.yml --snapshot 585 env: 586 GITHUB_TOKEN: ${{ secrets.CI_BOT_TOKEN }} 587 DOCKER_BUILDX_BUILDER: "${{ steps.buildx.outputs.name }}" 588 DOCKER_BUILDX_CACHE_FROM: "type=gha" 589 DOCKER_BUILDX_CACHE_TO: "type=gha,mode=max" 590 IMAGE_TAG_SHA: true 591 592 - name: Push image to the Registry 593 run: | 594 docker push kubeshop/testkube-playwright-executor:${{ steps.commit.outputs.short }} 595 596 workflow_dispatch: 597 needs: [ api, single_executor, executor_jmeter, executor_jmeterd, jmeterd_slave, executor_maven, executor_gradle, executor_cypress, executor_playwright ] 598 runs-on: ubuntu-latest 599 steps: 600 - name: Checkout 601 uses: actions/checkout@v2 602 603 - name: Get commit sha 604 id: github_sha 605 run: echo "::set-output name=sha_short::${GITHUB_SHA::7}" 606 607 - name: Repository Dispatch 608 uses: peter-evans/repository-dispatch@v2 609 with: 610 token: ${{ secrets.CI_BOT_TOKEN }} 611 repository: kubeshop/helm-charts 612 event-type: trigger-workflow-api-release 613 client-payload: '{"image_tag_api": "${{ steps.github_sha.outputs.sha_short }}"}'