|
378 | 378 | ref: master
|
379 | 379 | path: dockerfile
|
380 | 380 |
|
| 381 | + - name: Login to Docker Hub |
| 382 | + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 |
| 383 | + with: |
| 384 | + username: ${{ secrets.DOCKER_USERNAME }} |
| 385 | + password: ${{ secrets.DOCKER_PASSWORD }} |
| 386 | + |
| 387 | + - name: Login to GitHub Container Registry |
| 388 | + uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 |
| 389 | + with: |
| 390 | + registry: ghcr.io |
| 391 | + username: "edgedb-ci" |
| 392 | + password: ${{ secrets.GITHUB_CI_BOT_TOKEN }} |
| 393 | + |
381 | 394 | - env:
|
382 | 395 | VERSION_SLOT: "${{ << pub_outputs >>.version-slot }}"
|
383 | 396 | VERSION_CORE: "${{ << pub_outputs >>.version-core }}"
|
| 397 | + CATALOG_VERSION: "${{ << pub_outputs >>.catalog-version }}" |
384 | 398 | PKG_SUBDIST: "<< subdist >>"
|
385 | 399 | id: tags
|
386 | 400 | run: |
|
|
398 | 412 | done | grep "^[[:digit:]]\+.*" | grep -v "alpha\|beta\|rc" || :
|
399 | 413 | )
|
400 | 414 |
|
401 |
| - tags=( "$VERSION_CORE" ) |
| 415 | + tags=() |
402 | 416 |
|
403 |
| - top=$(printf "%s\n%s\n" "$VERSION_CORE" "$repo_tags" \ |
404 |
| - | grep "^${VERSION_SLOT}[\.-]" \ |
405 |
| - | sort --version-sort --reverse | head -n 1) |
406 |
| - if [ "$top" == "$VERSION_CORE" ]; then |
407 |
| - tags+=( "$VERSION_SLOT" ) |
408 |
| - fi |
| 417 | + if [ "$PKG_SUBDIST" = "nightly" ]; then |
| 418 | + tags+=( |
| 419 | + "nightly" |
| 420 | + "nightly_${VERSION_SLOT}_cv${CATALOG_VERSION}" |
| 421 | + ) |
| 422 | + else |
| 423 | + tags+=( "$VERSION_CORE" ) |
409 | 424 |
|
410 |
| - if [ -z "$PKG_SUBDIST" ]; then |
411 | 425 | top=$(printf "%s\n%s\n" "$VERSION_CORE" "$repo_tags" \
|
| 426 | + | grep "^${VERSION_SLOT}[\.-]" \ |
412 | 427 | | sort --version-sort --reverse | head -n 1)
|
413 | 428 | if [ "$top" == "$VERSION_CORE" ]; then
|
414 |
| - tags+=( "latest" ) |
| 429 | + tags+=( "$VERSION_SLOT" ) |
| 430 | + fi |
| 431 | +
|
| 432 | + if [ -z "$PKG_SUBDIST" ]; then |
| 433 | + top=$(printf "%s\n%s\n" "$VERSION_CORE" "$repo_tags" \ |
| 434 | + | sort --version-sort --reverse | head -n 1) |
| 435 | + if [ "$top" == "$VERSION_CORE" ]; then |
| 436 | + tags+=( "latest" ) |
| 437 | + fi |
415 | 438 | fi
|
416 | 439 | fi
|
417 | 440 |
|
| 441 | + fq_tags=() |
| 442 | + images=("geldata/gel" "ghcr.io/geldata/gel") |
| 443 | +
|
| 444 | + for image in "${images[@]}"; do |
| 445 | + fq_tags+=("${tags[@]/#/$image}") |
| 446 | + done |
| 447 | +
|
418 | 448 | IFS=,
|
419 |
| - echo "tags=${tags[*]}" >> $GITHUB_OUTPUT |
| 449 | + echo "tags=${fq_tags[*]}" >> $GITHUB_OUTPUT |
420 | 450 |
|
421 | 451 | - name: Set up QEMU
|
422 |
| - uses: docker/setup-qemu-action@v2 |
| 452 | + uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 |
423 | 453 |
|
424 | 454 | - name: Set up Docker Buildx
|
425 |
| - uses: docker/setup-buildx-action@edfb0fe6204400c56fbfd3feba3fe9ad1adfa345 # v3 |
| 455 | + uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 |
426 | 456 |
|
427 |
| - - name: Publish Docker Image (docker.io) |
428 |
| - uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5 |
| 457 | + - name: Build and Publish Docker Image |
| 458 | + uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.10.0 |
429 | 459 | with:
|
430 |
| - name: geldata/gel |
431 |
| - username: ${{ secrets.DOCKER_USERNAME }} |
432 |
| - password: ${{ secrets.DOCKER_PASSWORD }} |
433 |
| - <%- if subdist == "nightly" %> |
434 |
| - tags: "nightly,nightly_${{ << pub_outputs >>.version-slot }}_cv${{ << pub_outputs >>.catalog-version }}" |
435 |
| - <%- else %> |
| 460 | + push: true |
| 461 | + provenance: mode=max |
436 | 462 | tags: "${{ steps.tags.outputs.tags }}"
|
437 |
| - <%- endif %> |
438 |
| - workdir: dockerfile |
439 |
| - buildargs: branding=gel,version=${{ << pub_outputs >>.version-slot }},exact_version=${{ << pub_outputs >>.version-core }}<% if subdist != "" %>,subdist=<< subdist >><% endif %> |
440 |
| - platforms: << docker_tgts|map(attribute="docker_arch")|join(",") >> |
441 |
| - |
442 |
| - - name: Publish Docker Image (ghcr.io) |
443 |
| - uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5 |
444 |
| - with: |
445 |
| - registry: ghcr.io |
446 |
| - name: ${{ github.repository }} |
447 |
| - username: "edgedb-ci" |
448 |
| - password: ${{ secrets.GITHUB_CI_BOT_TOKEN }} |
449 |
| - <%- if subdist == "nightly" %> |
450 |
| - tags: "nightly,nightly_${{ << pub_outputs >>.version-slot }}_cv${{ << pub_outputs >>.catalog-version }}" |
451 |
| - <%- else %> |
452 |
| - tags: "${{ steps.tags.outputs.tags }}" |
453 |
| - <%- endif %> |
454 |
| - workdir: dockerfile |
455 |
| - buildargs: branding=gel,version=${{ << pub_outputs >>.version-slot }},exact_version=${{ << pub_outputs >>.version-core }}<% if subdist != "" %>,subdist=<< subdist >><% endif %> |
| 463 | + context: dockerfile |
| 464 | + build-args: | |
| 465 | + version=${{ << pub_outputs >>.version-slot }} |
| 466 | + exact_version=${{ << pub_outputs >>.version-core }} |
| 467 | + <%- if subdist != "" %> |
| 468 | + subdist=<< subdist >> |
| 469 | + <%- endif %> |
456 | 470 | platforms: << docker_tgts|map(attribute="docker_arch")|join(",") >>
|
457 | 471 | <%- endif %>
|
458 | 472 |
|
|
0 commit comments