11name : Docker
2+
23on :
34 push :
4- branches : [ master, beta ]
5- # Publish semver tags as releases.
6- tags : [ 'v*.*.*' ]
5+ branches :
6+ - master
7+ - develop
8+ tags :
9+ - ' v*.*.*'
10+ workflow_dispatch :
11+ inputs :
12+ tag_suffix :
13+ description : ' Tag suffix (e.g., latest, develop, or version like 1.0.0)'
14+ required : true
15+ default : ' latest'
716
817env :
918 REGISTRY : ghcr.io
@@ -18,52 +27,55 @@ jobs:
1827
1928 steps :
2029 - name : Checkout repository
21- uses : actions/checkout@v3
30+ uses : actions/checkout@v4
2231 with :
2332 fetch-depth : 0
33+
2434 - name : Set up QEMU
25- uses : docker/setup-qemu-action@v2
35+ uses : docker/setup-qemu-action@v3
2636 with :
2737 platforms : ' arm64,arm'
38+
2839 - name : Set up Docker Buildx
29- uses : docker/setup-buildx-action@v2
30- # Login against a Docker registry except on PR
31- # https://github.com/docker/login-action
40+ uses : docker/setup-buildx-action@v3
41+
3242 - name : Log into registry ${{ env.REGISTRY }}
3343 if : github.event_name != 'pull_request'
34- uses : docker/login-action@v2
44+ uses : docker/login-action@v3
3545 with :
3646 registry : ${{ env.REGISTRY }}
3747 username : ${{ github.actor }}
3848 password : ${{ secrets.GITHUB_TOKEN }}
39- # Extract metadata (tags, labels) for Docker
40- # https://github.com/docker/metadata-action
49+
4150 - name : Extract Docker metadata
4251 id : meta
43- uses : docker/metadata-action@v4
52+ uses : docker/metadata-action@v5
4453 with :
54+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
4555 flavor : |
4656 latest=false
4757 tags : |
48- type=ref,enable=true,event=branch,suffix=-collector
49- type=semver,pattern=v{{major}}.{{minor}}.{{patch}},suffix=-collector
50- type=semver,pattern=v{{major}}.{{minor}},suffix=-collector
51- type=semver,pattern=v{{major}},suffix=-collector
52- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
58+ # Manual trigger
59+ type=raw,value=${{ inputs.tag_suffix }}-collector,enable=${{ github.event_name == 'workflow_dispatch' }}
60+ # Branch builds
61+ type=raw,value=latest-collector,enable=${{ github.ref == 'refs/heads/master' && github.event_name != 'workflow_dispatch' }}
62+ type=raw,value=develop-collector,enable=${{ github.ref == 'refs/heads/develop' && github.event_name != 'workflow_dispatch' }}
63+ # Version tags
64+ type=semver,pattern={{version}}-collector
65+ type=semver,pattern={{major}}.{{minor}}-collector
66+ type=semver,pattern={{major}}-collector,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
5367
54- # Build and push Docker image with Buildx (don't push on PR)
55- # https://github.com/docker/build-push-action
5668 - name : Build and push Docker image
57- uses : docker/build-push-action@v3
69+ uses : docker/build-push-action@v5
5870 with :
5971 platforms : linux/amd64,linux/arm64,linux/arm/v7
6072 context : .
6173 file : docker/Dockerfile.collector
62- push : ${{ github.event_name != 'pull_request' }}
74+ push : true
6375 tags : ${{ steps.meta.outputs.tags }}
6476 labels : ${{ steps.meta.outputs.labels }}
65- # cache-from: type=gha
66- # cache-to: type=gha,mode=max
77+ cache-from : type=gha
78+ cache-to : type=gha,mode=max
6779
6880 web :
6981 runs-on : ubuntu-latest
@@ -73,51 +85,57 @@ jobs:
7385
7486 steps :
7587 - name : Checkout repository
76- uses : actions/checkout@v2
77- - name : " Populate frontend version information"
78- run : " cd webapp/frontend && ./git.version.sh"
88+ uses : actions/checkout@v4
89+
90+ - name : Populate frontend version information
91+ run : cd webapp/frontend && ./git.version.sh
92+
7993 - name : Set up QEMU
80- uses : docker/setup-qemu-action@v2
94+ uses : docker/setup-qemu-action@v3
8195 with :
8296 platforms : ' arm64,arm'
97+
8398 - name : Set up Docker Buildx
84- uses : docker/setup-buildx-action@v2
85- # Login against a Docker registry except on PR
86- # https://github.com/docker/login-action
99+ uses : docker/setup-buildx-action@v3
100+
87101 - name : Log into registry ${{ env.REGISTRY }}
88102 if : github.event_name != 'pull_request'
89- uses : docker/login-action@v2
103+ uses : docker/login-action@v3
90104 with :
91105 registry : ${{ env.REGISTRY }}
92106 username : ${{ github.actor }}
93107 password : ${{ secrets.GITHUB_TOKEN }}
94- # Extract metadata (tags, labels) for Docker
95- # https://github.com/docker/metadata-action
108+
96109 - name : Extract Docker metadata
97110 id : meta
98- uses : docker/metadata-action@v4
111+ uses : docker/metadata-action@v5
99112 with :
113+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
100114 flavor : |
101115 latest=false
102116 tags : |
103- type=ref,enable=true,event=branch,suffix=-web
104- type=semver,pattern=v{{major}}.{{minor}}.{{patch}},suffix=-web
105- type=semver,pattern=v{{major}}.{{minor}},suffix=-web
106- type=semver,pattern=v{{major}},suffix=-web
107- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
108- # Build and push Docker image with Buildx (don't push on PR)
109- # https://github.com/docker/build-push-action
117+ # Manual trigger
118+ type=raw,value=${{ inputs.tag_suffix }}-web,enable=${{ github.event_name == 'workflow_dispatch' }}
119+ # Branch builds
120+ type=raw,value=latest-web,enable=${{ github.ref == 'refs/heads/master' && github.event_name != 'workflow_dispatch' }}
121+ type=raw,value=develop-web,enable=${{ github.ref == 'refs/heads/develop' && github.event_name != 'workflow_dispatch' }}
122+ # Version tags
123+ type=semver,pattern={{version}}-web
124+ type=semver,pattern={{major}}.{{minor}}-web
125+ type=semver,pattern={{major}}-web,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
126+
110127 - name : Build and push Docker image
111- uses : docker/build-push-action@v3
128+ uses : docker/build-push-action@v5
112129 with :
113130 platforms : linux/amd64,linux/arm64,linux/arm/v7
114131 context : .
115132 file : docker/Dockerfile.web
116- push : ${{ github.event_name != 'pull_request' }}
133+ push : true
117134 tags : ${{ steps.meta.outputs.tags }}
118135 labels : ${{ steps.meta.outputs.labels }}
119- # cache-from: type=gha
120- # cache-to: type=gha,mode=max
136+ cache-from : type=gha
137+ cache-to : type=gha,mode=max
138+
121139 omnibus :
122140 runs-on : ubuntu-latest
123141 permissions :
@@ -126,46 +144,56 @@ jobs:
126144
127145 steps :
128146 - name : Checkout repository
129- uses : actions/checkout@v2
130- - name : " Populate frontend version information"
131- run : " cd webapp/frontend && ./git.version.sh"
147+ uses : actions/checkout@v4
148+
149+ - name : Populate frontend version information
150+ run : cd webapp/frontend && ./git.version.sh
151+
132152 - name : Set up QEMU
133- uses : docker/setup-qemu-action@v2
153+ uses : docker/setup-qemu-action@v3
134154 with :
135155 platforms : ' arm64,arm'
156+
136157 - name : Set up Docker Buildx
137- uses : docker/setup-buildx-action@v2
138- # Login against a Docker registry except on PR
139- # https://github.com/docker/login-action
158+ uses : docker/setup-buildx-action@v3
159+
140160 - name : Log into registry ${{ env.REGISTRY }}
141161 if : github.event_name != 'pull_request'
142- uses : docker/login-action@v2
162+ uses : docker/login-action@v3
143163 with :
144164 registry : ${{ env.REGISTRY }}
145165 username : ${{ github.actor }}
146166 password : ${{ secrets.GITHUB_TOKEN }}
147- # Extract metadata (tags, labels) for Docker
148- # https://github.com/docker/metadata-action
167+
149168 - name : Extract Docker metadata
150169 id : meta
151- uses : docker/metadata-action@v4
170+ uses : docker/metadata-action@v5
152171 with :
153- tags : |
154- type=ref,enable=true,event=branch,suffix=-omnibus
155- type=semver,pattern=v{{major}}.{{minor}}.{{patch}},suffix=-omnibus
156- type=semver,pattern=v{{major}}.{{minor}},suffix=-omnibus
157- type=semver,pattern=v{{major}},suffix=-omnibus
158172 images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
159- # Build and push Docker image with Buildx (don't push on PR)
160- # https://github.com/docker/build-push-action
173+ flavor : |
174+ latest=false
175+ tags : |
176+ # Manual trigger
177+ type=raw,value=${{ inputs.tag_suffix }}-omnibus,enable=${{ github.event_name == 'workflow_dispatch' }}
178+ type=raw,value=${{ inputs.tag_suffix }},enable=${{ github.event_name == 'workflow_dispatch' && inputs.tag_suffix == 'latest' }}
179+ # Branch builds
180+ type=raw,value=latest-omnibus,enable=${{ github.ref == 'refs/heads/master' && github.event_name != 'workflow_dispatch' }}
181+ type=raw,value=develop-omnibus,enable=${{ github.ref == 'refs/heads/develop' && github.event_name != 'workflow_dispatch' }}
182+ # Version tags
183+ type=semver,pattern={{version}}-omnibus
184+ type=semver,pattern={{major}}.{{minor}}-omnibus
185+ type=semver,pattern={{major}}-omnibus,enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
186+ # Default latest tag (omnibus is the default)
187+ type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' && github.event_name != 'workflow_dispatch' }}
188+
161189 - name : Build and push Docker image
162- uses : docker/build-push-action@v3
190+ uses : docker/build-push-action@v5
163191 with :
164192 platforms : linux/amd64,linux/arm64
165193 context : .
166194 file : docker/Dockerfile
167- push : ${{ github.event_name != 'pull_request' }}
195+ push : true
168196 tags : ${{ steps.meta.outputs.tags }}
169197 labels : ${{ steps.meta.outputs.labels }}
170- # cache-from: type=gha
171- # cache-to: type=gha,mode=max
198+ cache-from : type=gha
199+ cache-to : type=gha,mode=max
0 commit comments