@@ -16,65 +16,84 @@ permissions:
16
16
17
17
jobs :
18
18
build :
19
- name : " Build and push ${{ matrix.tag }}:latest"
20
19
runs-on : ubuntu-latest
21
20
strategy :
22
21
fail-fast : false
23
22
matrix :
24
- tag :
25
- - steamcmd
26
- - docker-ark
23
+ include :
24
+ - name : " SteamCMD Interactive"
25
+ image : steamcmd
26
+ variant : interactive
27
+ dockerfile : Dockerfile.interactive
28
+ tags : |
29
+ ghcr.io/${{ github.repository_owner }}/steamcmd:interactive
30
+ docker.io/${{ github.repository_owner }}/steamcmd:interactive
31
+ - name : " SteamCMD Non-Interactive"
32
+ image : steamcmd
33
+ variant : noninteractive
34
+ dockerfile : Dockerfile.noninteractive
35
+ tags : |
36
+ ghcr.io/${{ github.repository_owner }}/steamcmd:noninteractive
37
+ docker.io/${{ github.repository_owner }}/steamcmd:noninteractive
38
+ ghcr.io/${{ github.repository_owner }}/steamcmd:latest
39
+ docker.io/${{ github.repository_owner }}/steamcmd:latest
40
+ - name : " Docker ARK Server"
41
+ image : docker-ark
42
+ variant : default
43
+ dockerfile : Dockerfile
44
+ tags : |
45
+ ghcr.io/${{ github.repository_owner }}/docker-ark:latest
46
+ docker.io/${{ github.repository_owner }}/docker-ark:latest
27
47
28
48
steps :
29
49
- name : Checkout repository
30
50
uses : actions/checkout@v4
31
51
with :
32
52
fetch-depth : 0
33
53
34
- - name : Detect changes in ${{ matrix.tag }}
54
+ - name : Detect changes
35
55
id : changes
36
56
uses : dorny/paths-filter@v3
37
57
with :
38
58
list-files : json
39
59
filters : |
40
- ${{ matrix.tag }} :
41
- - ' images/${{ matrix.tag }}/**'
60
+ build :
61
+ - images/${{ matrix.image }}/**
42
62
43
63
- name : Repository owner to lowercase
44
- if : ${{ steps.changes.outputs[matrix.tag] == 'true' }}
64
+ if : steps.changes.outputs.build == 'true'
45
65
id : lower-repo
46
66
run : echo "repository=$(echo $GITHUB_REPOSITORY_OWNER | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
47
67
48
68
- name : Setup Docker Buildx
49
- if : ${{ steps.changes.outputs[matrix.tag] == 'true' }}
69
+ if : steps.changes.outputs.build == 'true'
50
70
uses : docker/setup-buildx-action@v3
51
71
52
72
- name : Login to GitHub Container Registry
53
- if : ${{ steps.changes.outputs[matrix.tag] == 'true' }}
73
+ if : steps.changes.outputs.build == 'true'
54
74
uses : docker/login-action@v3
55
75
with :
56
76
registry : ghcr.io
57
77
username : ${{ github.repository_owner }}
58
78
password : ${{ secrets.GITHUB_TOKEN }}
59
79
60
80
- name : Login to Docker Hub
61
- if : ${{ steps.changes.outputs[matrix.tag] == 'true' }}
81
+ if : steps.changes.outputs.build == 'true'
62
82
uses : docker/login-action@v3
63
83
with :
64
84
username : ${{ vars.DOCKERHUB_USERNAME }}
65
85
password : ${{ secrets.DOCKERHUB_TOKEN }}
66
86
67
- - name : Build and push to GHCR and DockerHub
68
- if : ${{ steps.changes.outputs[matrix.tag] == 'true' }}
87
+ - name : Build and push
88
+ if : steps.changes.outputs.build == 'true'
69
89
uses : docker/build-push-action@v6
70
90
with :
71
- context : ./images/${{ matrix.tag }}
72
- file : ./images/${{ matrix.tag }}/Dockerfile
91
+ context : ./images/${{ matrix.image }}
92
+ file : ./images/${{ matrix.image }}/${{ matrix.dockerfile }}
73
93
platforms : linux/amd64
74
94
push : true
75
95
provenance : false
76
96
cache-from : type=gha
77
97
cache-to : type=gha,mode=max
78
98
tags : |
79
- ghcr.io/${{ steps.lower-repo.outputs.repository }}/${{ matrix.tag }}:latest
80
- docker.io/${{ vars.DOCKERHUB_USERNAME }}/${{ matrix.tag }}:latest
99
+ ${{ matrix.tags }}
0 commit comments