Skip to content

Bump docker/setup-buildx-action from 2.10.0 to 3.0.0 #1686

Bump docker/setup-buildx-action from 2.10.0 to 3.0.0

Bump docker/setup-buildx-action from 2.10.0 to 3.0.0 #1686

Workflow file for this run

name: Build
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
scalaVersion: ['2.12.18', '2.13.12', '3.3.1']
javaTag: [
'graalvm-ce-22.3.3-b1-java17',
'graalvm-ce-22.3.3-b1-java11',
'eclipse-temurin-jammy-20.0.2_9',
'eclipse-temurin-jammy-17.0.8.1_1',
'eclipse-temurin-jammy-11.0.20.1_1',
'eclipse-temurin-jammy-8u382-b05',
'eclipse-temurin-focal-17.0.8.1_1',
'eclipse-temurin-focal-11.0.20.1_1',
]
include:
# https://github.com/graalvm/container/pkgs/container/graalvm-ce
- javaTag: 'graalvm-ce-22.3.3-b1-java17'
dockerContext: 'graalvm-ce'
baseImageTag: 'ol9-java17-22.3.3-b1'
platforms: 'linux/amd64,linux/arm64'
- javaTag: 'graalvm-ce-22.3.3-b1-java11'
dockerContext: 'graalvm-ce'
baseImageTag: 'ol9-java11-22.3.3-b1'
platforms: 'linux/amd64'
# https://hub.docker.com/_/eclipse-temurin/tags
- javaTag: 'eclipse-temurin-jammy-20.0.2_9'
dockerContext: 'eclipse-temurin'
baseImageTag: '20.0.2_9-jdk-jammy'
platforms: 'linux/amd64,linux/arm64'
- javaTag: 'eclipse-temurin-jammy-17.0.8.1_1'
dockerContext: 'eclipse-temurin'
baseImageTag: '17.0.8.1_1-jdk-jammy'
platforms: 'linux/amd64,linux/arm64'
- javaTag: 'eclipse-temurin-jammy-11.0.20.1_1'
dockerContext: 'eclipse-temurin'
baseImageTag: '11.0.20.1_1-jdk-jammy'
platforms: 'linux/amd64,linux/arm64'
- javaTag: 'eclipse-temurin-jammy-8u382-b05'
dockerContext: 'eclipse-temurin'
baseImageTag: '8u382-b05-jdk-jammy'
platforms: 'linux/amd64,linux/arm64'
- javaTag: 'eclipse-temurin-focal-17.0.8.1_1'
dockerContext: 'eclipse-temurin'
baseImageTag: '17.0.8.1_1-jdk-focal'
platforms: 'linux/amd64,linux/arm64'
- javaTag: 'eclipse-temurin-focal-11.0.20.1_1'
dockerContext: 'eclipse-temurin'
baseImageTag: '11.0.20.1_1-jdk-focal'
platforms: 'linux/amd64,linux/arm64'
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2.2.0
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3.0.0
# with:
# install: true
- name: Available platforms
run: echo ${{ steps.buildx.outputs.platforms }}
- name: Get latest SBT version
id: get_sbt_version
run: |
SBT_VERSION=$(
curl --silent -L https://github.com/sbt/sbt/releases |
grep -i -w -o '>[0-9]*\.[0-9]*\.[0-9]*</a>' |
grep -i -w -o '[0-9]*\.[0-9]*\.[0-9]*' |
sort --version-sort | tail -n 1)
[[ -z "$SBT_VERSION" ]] && { echo "Failed to get latest sbt version" ; exit 1; }
echo "VERSION=$SBT_VERSION" >> $GITHUB_OUTPUT
- name: Create docker tag
id: create_docker_tag
run: |
TAG=sbtscala/scala-sbt:${{ matrix.javaTag }}_${{ steps.get_sbt_version.outputs.VERSION }}_${{ matrix.scalaVersion }}
echo "TAG=$TAG" >> $GITHUB_OUTPUT
- name: Build docker image
uses: docker/build-push-action@v4
with:
context: ${{ matrix.dockerContext }}
no-cache: true
tags: ${{ steps.create_docker_tag.outputs.TAG }}
build-args: |
BASE_IMAGE_TAG=${{ matrix.baseImageTag }}
SBT_VERSION=${{ steps.get_sbt_version.outputs.VERSION }}
SCALA_VERSION=${{ matrix.scalaVersion }}
load: true
- name: Test docker image as root (default)
if: ${{ !startsWith(matrix.scalaVersion, '2.12') }}
# scala --version does not work on < 2.13
run: |
docker run "${{ steps.create_docker_tag.outputs.TAG }}" \
scala --version &&
sbt about
- name: Test docker image scala as sbtuser
if: ${{ !startsWith(matrix.scalaVersion, '2.12') }}
# scala --version does not work on < 2.13
run: |
docker run -u sbtuser -w /home/sbtuser "${{ steps.create_docker_tag.outputs.TAG }}" \
scala --version &&
sbt about
- name: Log in to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Rebuild and push ${{ matrix.platforms }} docker images
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v4
with:
context: ${{ matrix.dockerContext }}
tags: ${{ steps.create_docker_tag.outputs.TAG }}
build-args: |
BASE_IMAGE_TAG=${{ matrix.baseImageTag }}
SBT_VERSION=${{ steps.get_sbt_version.outputs.VERSION }}
SCALA_VERSION=${{ matrix.scalaVersion }}
platforms: ${{ matrix.platforms }}
push: true