diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16d5b5b..800f34c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -54,3 +54,39 @@ jobs: GIT_USERNAME: ${{ github.actor }} GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }} DOCKER_IMAGE_NAME: "galaxioteam/base" + java-build: + strategy: + matrix: + java-version: [ 17, 21 ] + runs-on: ubuntu-22.04 + container: + image: gcr.io/kaniko-project/executor:v1.20.0-debug + needs: base-build + permissions: + contents: read # read the repository + steps: + - name: Test Java Build with kaniko + run: | + cat < /kaniko/.docker/config.json + { + "auths": { + "https://index.docker.io/v1/": { + "auth": "$(echo -n "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" | base64 )" + } + } + } + EOF + + export IFS='' + /kaniko/executor --dockerfile="java.Dockerfile" \ + --context="${{ github.repositoryUrl }}#${{ github.ref }}#${{ github.sha }}" \ + --build-arg "BASE_VERSION=${GITHUB_REF##*/}" \ + --build-arg "JAVA_VERSION=${{ matrix.java-version }}" \ + --cleanup \ + --destination="$DOCKER_IMAGE_NAME:${{ matrix.java-version }}-${GITHUB_REF##*/}" \ + ${{ env.KANIKO_CACHE_ARGS }} \ + --push-retry 5 + env: + GIT_USERNAME: ${{ github.actor }} + GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }} + DOCKER_IMAGE_NAME: "galaxioteam/base-jdk" \ No newline at end of file