76
76
name : Publish Docker Images
77
77
needs : generate-dockerfiles
78
78
runs-on : ubuntu-latest
79
+ permissions :
80
+ packages : write
81
+ contents : read
82
+ attestations : write
83
+ id-token : write
79
84
continue-on-error : true
80
85
strategy :
81
86
matrix : ${{ fromJSON(needs.generate-dockerfiles.outputs.matrix) }}
@@ -92,31 +97,39 @@ jobs:
92
97
run : rm -rf dockerfiles
93
98
94
99
- name : Download a Build Artifact
95
- uses : actions/download-artifact@v4.1.8
100
+ uses : actions/download-artifact@v4
96
101
with :
97
102
# Artifact name
98
103
name : Dockerfiles
99
104
# Destination path
100
105
path : dockerfiles
101
106
102
- - name : Set up QEMU
107
+ - name : Setup QEMU
103
108
uses : docker/setup-qemu-action@v3
104
109
105
- - name : Set up Docker Buildx
106
-
107
-
108
- - name : Login to DockerHub
109
-
110
+ - name : Login to Docker Hub
111
+ uses : docker/login-action@v3
110
112
with :
111
113
username : ${{ secrets.DOCKER_HUB_USERNAME }}
112
114
password : ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
113
115
114
116
- name : Login to GitHub Container Registry
115
- uses : docker/login-action@v3.3.0
117
+ uses : docker/login-action@v3
116
118
with :
117
119
registry : ghcr.io
118
120
username : ${{ github.actor }}
119
121
password : ${{ secrets.GITHUB_TOKEN }}
122
+
123
+ - name : Extract metadata (tags, labels) for Docker
124
+ id : meta
125
+ uses : docker/metadata-action@v5
126
+ with :
127
+ images : |
128
+ gameservermanagers/gameserver
129
+ ghcr.io/gameservermanagers/gameserver
130
+ tags : |
131
+ ${{ matrix.shortname }}
132
+
120
133
- name : Build and push
121
134
122
135
with :
@@ -126,9 +139,8 @@ jobs:
126
139
push : true
127
140
build-args : |
128
141
SHORTNAME=${{ matrix.shortname }}
129
- tags : |
130
- gameservermanagers/gameserver:${{ matrix.shortname }}
131
- ghcr.io/gameservermanagers/gameserver:${{ matrix.shortname }}
142
+ tags : ${{ steps.meta.outputs.tags }}
143
+ labels : ${{ steps.meta.outputs.labels }}
132
144
133
145
package-cleanup :
134
146
name : Cleanup Old GitHub Packages
0 commit comments