-
Notifications
You must be signed in to change notification settings - Fork 65
74 lines (67 loc) · 2.09 KB
/
build.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build and Publish
on:
push:
branches:
- master
- test/*
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
variant: [ latest, java17, java8, java11 ]
include:
- variant: latest
baseImage: eclipse-temurin:17-focal
tagPrefix: ""
- variant: java17
baseImage: eclipse-temurin:17-focal
tagPrefix: java17-
- variant: java8
baseImage: adoptopenjdk:8-jre-hotspot-focal
tagPrefix: java8-
- variant: java11
baseImage: adoptopenjdk:11-jre-hotspot-focal
tagPrefix: java11-
env:
DOCKER_HUB_ORG: itzg
steps:
- uses: actions/checkout@v4.1.1
- name: Docker meta
id: meta
uses: docker/metadata-action@v5.0.0
with:
images: |
${{ env.DOCKER_HUB_ORG }}/bungeecord
tags: |
type=ref,event=branch,prefix=${{ matrix.tagPrefix }}
type=ref,event=tag,prefix=${{ matrix.tagPrefix }}
type=raw,value=${{ matrix.variant }}
flavor: |
latest=false
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3.0.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3.0.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5.1.0
with:
platforms: linux/amd64,linux/arm/v7,linux/arm64
# ensure latest base image is used
pull: true
push: true
build-args: |
BASE_IMAGE=${{ matrix.baseImage }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=${{ matrix.variant }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant }}