Build #1327
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
scalaVersion: ['2.13.13'] | |
javaTag: ['11.0.22','17.0.10'] | |
include: | |
- javaTag: '17.0.10' | |
baseImageTag: '17.0.10_7-jdk-focal' | |
- javaTag: '11.0.22' | |
baseImageTag: '11.0.22_7-jdk-focal' | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Get latest SBT version | |
id: get_sbt_version | |
run: | | |
SBT_VERSION=$( | |
curl -L -s https://repo.scala-sbt.org/scalasbt/debian/Packages | | |
grep -i -w 'sbt-[0-9]*\.[0-9]*\.[0-9]*\.deb' -o | | |
grep -i -w '[0-9]*\.[0-9]*\.[0-9]*' -o | | |
sort -V | tail -n 1) | |
echo ::set-output name=VERSION::$SBT_VERSION | |
- name: Create docker tag | |
id: create_docker_tag | |
run: | | |
TAG=aauevt/ci-base:${{ matrix.javaTag }}_${{ steps.get_sbt_version.outputs.VERSION }}_${{ matrix.scalaVersion }} | |
echo ::set-output name=TAG::$TAG | |
- name: Build docker image | |
run: | | |
docker build . \ | |
--no-cache \ | |
-t "${{ steps.create_docker_tag.outputs.TAG }}" \ | |
--build-arg BASE_IMAGE_TAG=${{ matrix.baseImageTag }} \ | |
--build-arg SBT_VERSION=${{ steps.get_sbt_version.outputs.VERSION }} \ | |
--build-arg SCALA_VERSION=${{ matrix.scalaVersion }} | |
- name: Push image to DockerHub | |
if: github.event_name != 'pull_request' | |
run: | | |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u aauevt --password-stdin | |
docker push ${{ steps.create_docker_tag.outputs.TAG }} |