9
9
REGISTRY : ghcr.io
10
10
11
11
jobs :
12
- builder :
13
- env :
14
- IMAGE_NAME : plato-builder
15
-
12
+ docker-build :
16
13
runs-on : ubuntu-latest
17
14
18
- permissions :
19
- packages : write
20
- contents : read
21
-
22
- steps :
23
- - name : Checkout repository
24
- uses : actions/checkout@v4
25
- with :
26
- submodules : ' true'
27
-
28
- # Extract metadata (tags, labels) for Docker
29
- # https://github.com/docker/metadata-action
30
- - name : Extract Docker metadata
31
- id : meta
32
- uses : docker/metadata-action@v5
33
- with :
34
- images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
35
- flavor : latest=true
36
-
37
- - name : Log into registry ${{ env.REGISTRY }}
38
- uses : docker/login-action@v3
39
- with :
40
- registry : ${{ env.REGISTRY }}
41
- username : ${{ github.actor }}
42
- password : ${{ secrets.GITHUB_TOKEN }}
43
-
44
- # Build and push Docker image with Buildx (don't push on PR)
45
- # https://github.com/docker/build-push-action
46
- - name : Build and push Docker image
47
- id : build-and-push
48
- uses : docker/build-push-action@v6
49
- with :
50
- file : builder.Dockerfile
51
- context : ./plato
52
- push : ${{ github.event_name != 'pull_request' }}
53
- tags : ${{ steps.meta.outputs.tags }}
54
- labels : ${{ steps.meta.outputs.labels }}
55
-
56
- emulator :
57
- env :
58
- IMAGE_NAME : plato-emulator
59
-
60
- runs-on : ubuntu-latest
15
+ strategy :
16
+ matrix :
17
+ purpose : [builder, emulator]
61
18
62
19
permissions :
63
20
packages : write
75
32
id : meta
76
33
uses : docker/metadata-action@v5
77
34
with :
78
- images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
35
+ images : ${{ env.REGISTRY }}/${{ github.repository_owner }}/plato- ${{ matrix.purpose }}
79
36
flavor : latest=true
80
37
81
38
- name : Log into registry ${{ env.REGISTRY }}
@@ -91,14 +48,14 @@ jobs:
91
48
id : build-and-push
92
49
uses : docker/build-push-action@v6
93
50
with :
94
- file : emulator .Dockerfile
51
+ file : ${{ matrix.purpose }} .Dockerfile
95
52
context : ./plato
96
53
push : ${{ github.event_name != 'pull_request' }}
97
54
tags : ${{ steps.meta.outputs.tags }}
98
55
labels : ${{ steps.meta.outputs.labels }}
99
56
100
57
image-layers :
101
- needs : [builder, emulator]
58
+ needs : docker-build
102
59
103
60
runs-on : ubuntu-latest
104
61
0 commit comments