-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (110 loc) · 3.68 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Build Images
on:
push:
schedule:
- cron: '0 11 * * *'
env:
REGISTRY: ghcr.io
concurrency:
group: "${{ github.event_name}}-${{ github.ref }}"
cancel-in-progress: true
jobs:
build-images:
name: "Build Docker image"
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
environment: Release
strategy:
matrix:
image:
- path: java/eclipse-temurin
file: alpine.Dockerfile
arg: JAVA_VERSION=8
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=8-alpine
platform: linux/amd64
- path: java/eclipse-temurin
file: alpine.Dockerfile
arg: JAVA_VERSION=11
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=11-alpine
platform: linux/amd64
- path: java/eclipse-temurin
file: alpine.Dockerfile
arg: JAVA_VERSION=17
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=17-alpine
platform: linux/amd64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=8
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=8
platform: linux/amd64,linux/arm64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=11
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=11
platform: linux/amd64,linux/arm64
- path: java/eclipse-temurin
file: ubuntu.Dockerfile
arg: JAVA_VERSION=17
image: pufferpanel/eclipse-temurin
tags: |
type=raw,value=17
platform: linux/amd64,linux/arm64
- path: steamcmd
file: Dockerfile
image: pufferpanel/steamcmd
tags: |
type=raw,value=latest
platform: linux/amd64
- path: ubuntu
file: Dockerfile
image: pufferpanel/ubuntu
tags: |
type=raw,value=latest
platform: linux/amd64,linux/arm64
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Login to DockerHub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: |
${{ matrix.image.image }}
tags: |
${{ matrix.image.tags }}
- name: Check out code
uses: actions/checkout@v4
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: ${{ matrix.image.path }}
file: ${{ matrix.image.path }}/${{ matrix.image.file }}
push: ${{ github.event_name != 'pull_request' && env.REGISTRY_USERNAME != '' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
${{ matrix.image.arg }}
platforms: ${{ matrix.image.platform }}