chore: add google auth step #126
Workflow file for this run
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 and validate | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
java-major-version: [11, 21] | |
platform: [linux/amd64, linux/arm64] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_READ_USER }} | |
password: ${{ secrets.DOCKERHUB_READ_TOKEN }} | |
- name: Read Java Version | |
shell: bash | |
id: versions | |
run: | | |
ZULU_JDK_VERSION=$(cat java-${{ matrix.java-major-version}}/java.version | tr -d "\n") | |
echo ZULU_JDK_VERSION=${ZULU_JDK_VERSION} >> $GITHUB_OUTPUT | |
BASE_IMAGE=$(cat java-${{ matrix.java-major-version}}/base.image | tr -d "\n") | |
echo BASE_IMAGE=${BASE_IMAGE} >> $GITHUB_OUTPUT | |
- name: Build java-${{ matrix.java-major-version}} | |
uses: docker/build-push-action@v5 | |
with: | |
context: java-${{ matrix.java-major-version}} | |
platforms: ${{ matrix.platform }} | |
build-args: | | |
JAVA_VERSION=${{ steps.versions.outputs.ZULU_JDK_VERSION }} | |
BASE_IMAGE=${{ steps.versions.outputs.BASE_IMAGE }} | |
tags: hypertrace/java-build:${{ matrix.java-major-version}} | |
load: true | |
- name: Scan java-${{ matrix.java-major-version}} image | |
uses: hypertrace/github-actions/trivy-image-scan@main | |
with: | |
image: hypertrace/java-build | |
tag: ${{ matrix.java-major-version}} | |
category: java-${{ matrix.java-major-version}} | |
output-mode: github |