74
74
- name : Setup QEMU
75
75
uses : docker/setup-qemu-action@v3
76
76
77
- - name : Setup Docker Buildx
78
- uses : docker/setup-buildx-action@v3
79
-
80
- - name : Build
81
- run : docker build -t gameservermanagers/steamcmd:ubuntu-22.04 -f ./Dockerfile.ubuntu-2204 .
82
-
83
- - name : Login to DockerHub
77
+ - name : Login to Docker Hub
84
78
uses : docker/login-action@v3
85
79
with :
86
80
username : ${{ secrets.DOCKER_HUB_USERNAME }}
@@ -93,16 +87,28 @@ jobs:
93
87
username : ${{ github.actor }}
94
88
password : ${{ secrets.GITHUB_TOKEN }}
95
89
90
+ - name : Extract metadata (tags, labels) for Docker
91
+ id : meta
92
+ uses : docker/metadata-action@v5
93
+ with :
94
+ images : |
95
+ gameservermanagers/steamcmd
96
+ ghcr.io/gameservermanagers/steamcmd
97
+ tags : |
98
+ latest
99
+ ubuntu
100
+ ubuntu-22.04
101
+
96
102
- name : Build and push (Ubuntu 22.04)
97
103
uses : docker/build-push-action@v6
98
104
with :
99
105
context : .
100
106
file : ./Dockerfile.ubuntu-2204
101
107
platforms : linux/amd64
102
108
push : true
103
- tags : |
104
- gameservermanagers/steamcmd:ubuntu-22.04
105
- ghcr.io/gameservermanagers/steamcmd:ubuntu-22.04
109
+ tags : ${{ steps.meta.outputs.tags }}
110
+ labels : ${{ steps.meta.outputs.labels }}
111
+
106
112
107
113
build-ubuntu-2004 :
108
114
name : Build Ubuntu 20.04
@@ -119,14 +125,8 @@ jobs:
119
125
- name : Setup QEMU
120
126
uses : docker/setup-qemu-action@v3
121
127
122
- - name : Setup Docker Buildx
123
- uses : docker/setup-buildx-action@v3
124
-
125
- - name : Build
126
- run : docker build -t gameservermanagers/steamcmd:ubuntu-20.04 -f ./Dockerfile.ubuntu-2004 .
127
-
128
- - name : Login to DockerHub
129
- uses : docker/login-action@v3.3.0
128
+ - name : Login to Docker Hub
129
+ uses : docker/login-action@v3
130
130
with :
131
131
username : ${{ secrets.DOCKER_HUB_USERNAME }}
132
132
password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
@@ -138,60 +138,31 @@ jobs:
138
138
username : ${{ github.actor }}
139
139
password : ${{ secrets.GITHUB_TOKEN }}
140
140
141
- - name : Build and push (Ubuntu 20.04)
142
- uses : docker/build-push-action@v6
141
+ - name : Extract metadata (tags, labels) for Docker
142
+ id : meta
143
+ uses : docker/metadata-action@v5
143
144
with :
144
- context : .
145
- file : ./Dockerfile.ubuntu-2004
146
- platforms : linux/amd64
147
- push : true
145
+ images : |
146
+ gameservermanagers/steamcmd
147
+ ghcr.io/gameservermanagers/steamcmd
148
148
tags : |
149
- gameservermanagers/steamcmd:ubuntu-20.04
150
- ghcr.io/gameservermanagers/steamcmd:ubuntu-20.04
151
-
152
- build-ubuntu-1804 :
153
- name : Build Ubuntu 18.04
154
- runs-on : ubuntu-latest
155
- steps :
156
- - name : Checkout
157
- uses : actions/checkout@v4
158
-
159
- - name : Setup QEMU
160
- uses : docker/setup-qemu-action@v3
161
-
162
- - name : Setup Docker Buildx
163
- uses : docker/setup-buildx-action@v3
164
-
165
- - name : Build
166
- run : docker build -t gameservermanagers/steamcmd:ubuntu-18.04 -f ./Dockerfile.ubuntu-1804 .
167
-
168
- - name : Login to DockerHub
169
- uses : docker/login-action@v3.3.0
170
- with :
171
- username : ${{ secrets.DOCKER_HUB_USERNAME }}
172
- password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
149
+ latest
150
+ ubuntu
151
+ ubuntu-20.04
173
152
174
- - name : Login to GitHub Container Registry
175
- uses : docker/login-action@v3
176
- with :
177
- registry : ghcr.io
178
- username : ${{ github.actor }}
179
- password : ${{ secrets.GITHUB_TOKEN }}
180
-
181
- - name : Build and push (Ubuntu 18.04)
153
+ - name : Build and push (Ubuntu 20.04)
182
154
uses : docker/build-push-action@v6
183
155
with :
184
156
context : .
185
- file : ./Dockerfile.ubuntu-1804
157
+ file : ./Dockerfile.ubuntu-2004
186
158
platforms : linux/amd64
187
159
push : true
188
- tags : |
189
- gameservermanagers/steamcmd:ubuntu-18.04
190
- ghcr.io/gameservermanagers/steamcmd:ubuntu-18.04
160
+ tags : ${{ steps.meta.outputs.tags }}
161
+ labels : ${{ steps.meta.outputs.labels }}
191
162
192
163
package-cleanup :
193
164
name : Cleanup Old GitHub Packages
194
- needs : [ build-ubuntu-1804, build-ubuntu- 2004, build-ubuntu-2204, build-ubuntu-2404 ]
165
+ needs : [ build-ubuntu-2004, build-ubuntu-2204, build-ubuntu-2404 ]
195
166
runs-on : ubuntu-latest
196
167
steps :
197
168
- name : Delete Package Versions
0 commit comments