feat: add java image #11
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: Galaxio Docker Images Building | ||
on: | ||
pull_request: | ||
branches: [ '**' ] | ||
env: | ||
KANIKO_CACHE_ARGS: "--cache=true --cache-repo galaxioteam/base-cache --cache-copy-layers=true --cache-ttl=24h" | ||
jobs: | ||
base-build: | ||
runs-on: ubuntu-22.04 | ||
container: | ||
image: gcr.io/kaniko-project/executor:v1.20.0-debug | ||
permissions: | ||
contents: read # read the repository | ||
needs: test-build | ||
Check failure on line 17 in .github/workflows/pull-request-build.yml GitHub Actions / Galaxio Docker Images BuildingInvalid workflow file
|
||
steps: | ||
- name: Build and Push Image to docker registry with kaniko | ||
run: | | ||
cat <<EOF > /kaniko/.docker/config.json | ||
{ | ||
"auths": { | ||
"https://index.docker.io/v1/": { | ||
"auth": "$(echo -n "${{ secrets.DOCKER_USERNAME }}:${{ secrets.DOCKER_PASSWORD }}" | base64 )" | ||
} | ||
} | ||
} | ||
EOF | ||
/kaniko/executor --dockerfile="Dockerfile" \ | ||
--context="${{ github.repositoryUrl }}#${{ github.head_ref }}" \ | ||
--destination="$DOCKER_IMAGE_NAME:${GITHUB_SHA}" \ | ||
${{ env.KANIKO_CACHE_ARGS }} \ | ||
--push-retry 5 | ||
env: | ||
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 | ||
permissions: | ||
contents: read # read the repository | ||
steps: | ||
- name: Test Java Build with kaniko | ||
run: | | ||
cat <<EOF > /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.head_ref }}" \ | ||
--build-arg "BASE_VERSION=${GITHUB_SHA}" \ | ||
--build-arg "JAVA_VERSION=${{ matrix.java-version }}" \ | ||
--cleanup \ | ||
--destination="$DOCKER_IMAGE_NAME":${{ matrix.java-version }}-${GITHUB_SHA}" \ | ||
${{ env.KANIKO_CACHE_ARGS }} \ | ||
--push-retry 5 | ||
env: | ||
GIT_USERNAME: ${{ github.actor }} | ||
GIT_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
DOCKER_IMAGE_NAME: "galaxioteam/base-jdk" |