-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (57 loc) · 1.5 KB
/
java.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Java
on:
workflow_dispatch:
push:
branches:
- master
paths:
- java/**
jobs:
push:
name: "esdock:java_${{ matrix.tag }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag:
- 16
- 17
- 18
- 19
- 20
- 21
- 22
platform:
- linux/amd64
- linux/arm64
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Determine Base Image
id: base-image
run: |
if [[ "${{ matrix.platform }}" == "linux/arm64" ]]; then
if [[ ${{ matrix.tag }} -eq 16 ]]; then
echo "BASE_IMAGE=focal" >> $GITHUB_ENV
elif [[ ${{ matrix.tag }} -ge 17 && ${{ matrix.tag }} -le 20 ]]; then
echo "BASE_IMAGE=jammy" >> $GITHUB_ENV
fi
fi
- uses: docker/build-push-action@v5
with:
context: ./java
file: ./java/${{ matrix.tag }}/Dockerfile
platforms: ${{ matrix.platform }}
push: true
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
tags: |
ghcr.io/zastinian/esdock:java_${{ matrix.tag }}