Skip to content

Commit b8217ed

Browse files
committed
ci: update docker actions and enable multi-platform builds
- Update GitHub Actions to latest versions (checkout v6, docker login v4, buildx v4, metadata v6). - Add `docker/setup-qemu-action` to support multi-platform builds. - Configure Docker builds to target both `linux/amd64` and `linux/arm64`. - Enable GitHub Actions caching (`type=gha`) for Docker builds to improve performance. - Include metadata annotations in the build output. Signed-off-by: Ivan P <2119240+i5okie@users.noreply.github.com>
1 parent 86b952d commit b8217ed

3 files changed

Lines changed: 43 additions & 17 deletions

File tree

.github/actions/showcase-build-frontend/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ inputs:
2121
runs:
2222
using: composite
2323
steps:
24-
- uses: actions/checkout@v4
24+
- uses: actions/checkout@v6
2525

2626
# ghcr.io org packages: use repository owner (lowercase) with GITHUB_TOKEN — not github.actor
27-
- uses: docker/login-action@v3
27+
- uses: docker/login-action@v4
2828
with:
2929
registry: ghcr.io
3030
username: ${{ github.repository_owner }}
3131
password: ${{ inputs.github_token }}
3232

33-
- uses: docker/setup-buildx-action@v3
33+
- uses: docker/setup-qemu-action@v4
34+
35+
- uses: docker/setup-buildx-action@v4
3436

3537
- id: meta
36-
uses: docker/metadata-action@v5
38+
uses: docker/metadata-action@v6
3739
with:
3840
images: ${{ inputs.image }}
3941
tags: |
@@ -44,10 +46,14 @@ runs:
4446
context: .
4547
file: ./frontend/Dockerfile
4648
push: true
49+
platforms: linux/amd64,linux/arm64
4750
tags: ${{ steps.meta.outputs.tags }}
4851
labels: ${{ steps.meta.outputs.labels }}
52+
annotations: ${{ steps.meta.outputs.annotations }}
4953
provenance: mode=min
5054
sbom: true
55+
cache-from: type=gha
56+
cache-to: type=gha,mode=max
5157
build-args: |
5258
REACT_APP_INSIGHTS_PROJECT_ID=${{ inputs.react_app_insights_project_id }}
5359
REACT_APP_HOST_BACKEND=${{ inputs.react_app_host_backend }}

.github/actions/showcase-build-server/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,22 @@ inputs:
1414
runs:
1515
using: composite
1616
steps:
17-
- uses: actions/checkout@v4
17+
- uses: actions/checkout@v6
1818

1919
# ghcr.io org packages: use repository owner (lowercase) with GITHUB_TOKEN — not github.actor
2020
# (avoids "denied: installation not allowed to Write organization package"). See GitHub Packages docs.
21-
- uses: docker/login-action@v3
21+
- uses: docker/login-action@v4
2222
with:
2323
registry: ghcr.io
2424
username: ${{ github.repository_owner }}
2525
password: ${{ inputs.github_token }}
2626

27-
- uses: docker/setup-buildx-action@v3
27+
- uses: docker/setup-qemu-action@v4
28+
29+
- uses: docker/setup-buildx-action@v4
2830

2931
- id: meta
30-
uses: docker/metadata-action@v5
32+
uses: docker/metadata-action@v6
3133
with:
3234
images: ${{ inputs.image }}
3335
tags: |
@@ -38,7 +40,11 @@ runs:
3840
context: .
3941
file: ./server/Dockerfile
4042
push: true
43+
platforms: linux/amd64,linux/arm64
4144
tags: ${{ steps.meta.outputs.tags }}
4245
labels: ${{ steps.meta.outputs.labels }}
46+
annotations: ${{ steps.meta.outputs.annotations }}
4347
provenance: mode=min
4448
sbom: true
49+
cache-from: type=gha
50+
cache-to: type=gha,mode=max

.github/workflows/build_packages.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
contents: read
3131
steps:
3232
- name: Checkout
33-
uses: actions/checkout@v4
33+
uses: actions/checkout@v6
3434

3535
- name: Setup NodeJS
3636
uses: ./.github/actions/setup-node
@@ -86,21 +86,24 @@ jobs:
8686

8787
steps:
8888
- name: Checkout repository
89-
uses: actions/checkout@v4
89+
uses: actions/checkout@v6
9090

9191
- name: Log in to the Container registry
92-
uses: docker/login-action@v3
92+
uses: docker/login-action@v4
9393
with:
9494
registry: ${{ env.REGISTRY }}
9595
username: ${{ github.actor }}
9696
password: ${{ secrets.GITHUB_TOKEN }}
9797

98+
- name: Set up QEMU
99+
uses: docker/setup-qemu-action@v4
100+
98101
- name: Set up Docker Buildx
99-
uses: docker/setup-buildx-action@v3
102+
uses: docker/setup-buildx-action@v4
100103

101104
- name: Extract metadata (tags, labels) for Docker
102105
id: meta
103-
uses: docker/metadata-action@v5
106+
uses: docker/metadata-action@v6
104107
with:
105108
images: ${{ env.SHOWCASE_SERVER_IMAGE }}
106109

@@ -110,10 +113,14 @@ jobs:
110113
context: .
111114
file: ./server/Dockerfile
112115
push: true
116+
platforms: linux/amd64,linux/arm64
113117
tags: ${{ steps.meta.outputs.tags }}
114118
labels: ${{ steps.meta.outputs.labels }}
119+
annotations: ${{ steps.meta.outputs.annotations }}
115120
provenance: mode=min
116121
sbom: true
122+
cache-from: type=gha
123+
cache-to: type=gha,mode=max
117124

118125
build-and-push-image-frontend:
119126
runs-on: ubuntu-latest
@@ -127,21 +134,24 @@ jobs:
127134

128135
steps:
129136
- name: Checkout repository
130-
uses: actions/checkout@v4
137+
uses: actions/checkout@v6
131138

132139
- name: Log in to the Container registry
133-
uses: docker/login-action@v3
140+
uses: docker/login-action@v4
134141
with:
135142
registry: ${{ env.REGISTRY }}
136143
username: ${{ github.actor }}
137144
password: ${{ secrets.GITHUB_TOKEN }}
138145

146+
- name: Set up QEMU
147+
uses: docker/setup-qemu-action@v4
148+
139149
- name: Set up Docker Buildx
140-
uses: docker/setup-buildx-action@v3
150+
uses: docker/setup-buildx-action@v4
141151

142152
- name: Extract metadata (tags, labels) for Docker
143153
id: meta
144-
uses: docker/metadata-action@v5
154+
uses: docker/metadata-action@v6
145155
with:
146156
images: ${{ env.SHOWCASE_FRONTEND_IMAGE }}
147157

@@ -151,10 +161,14 @@ jobs:
151161
context: .
152162
file: ./frontend/Dockerfile
153163
push: true
164+
platforms: linux/amd64,linux/arm64
154165
tags: ${{ steps.meta.outputs.tags }}
155166
labels: ${{ steps.meta.outputs.labels }}
167+
annotations: ${{ steps.meta.outputs.annotations }}
156168
provenance: mode=min
157169
sbom: true
170+
cache-from: type=gha
171+
cache-to: type=gha,mode=max
158172
build-args: |
159173
REACT_APP_INSIGHTS_PROJECT_ID=${{ vars.REACT_APP_INSIGHTS_PROJECT_ID || secrets.REACT_APP_INSIGHTS_PROJECT_ID }}
160174
REACT_APP_HOST_BACKEND=${{ vars.REACT_APP_HOST_BACKEND || secrets.REACT_APP_HOST_BACKEND }}

0 commit comments

Comments
 (0)