Skip to content

Commit 3250676

Browse files
committed
ci: add platform selection input and npm timeout build args
- Add `platform` workflow input to allow targeting amd64, arm64, or both - Update Docker build steps to use dynamic platform selection based on input - Add NPM fetch timeout build args to frontend build to improve reliability - Add `act` binary for local GitHub Actions testing
1 parent 10bf83c commit 3250676

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ on:
1919
- be
2020
- fe
2121
- all
22-
22+
platform:
23+
description: 'Target platform'
24+
required: false
25+
default: 'all'
26+
type: choice
27+
options:
28+
- amd64
29+
- arm64
30+
- all
2331
jobs:
2432
build:
2533
runs-on: ubuntu-latest
@@ -183,7 +191,7 @@ jobs:
183191
with:
184192
context: ${{ env.BUILD_DIR_BE }}
185193
file: ${{ env.BUILD_DIR_BE }}/Dockerfile
186-
platforms: linux/amd64,linux/arm64
194+
platforms: ${{ inputs.platform == 'all' && 'linux/amd64,linux/arm64' || format('linux/{0}', inputs.platform) }}
187195
push: true
188196
tags: |
189197
ghcr.io/openimis/openimis-be:${{ env.TAG_BE }}
@@ -196,9 +204,13 @@ jobs:
196204
with:
197205
context: ${{ env.BUILD_DIR_FE }}
198206
file: ${{ env.BUILD_DIR_FE }}/Dockerfile
199-
platforms: linux/amd64,linux/arm64
207+
platforms: ${{ inputs.platform == 'all' && 'linux/amd64,linux/arm64' || format('linux/{0}', inputs.platform) }}
200208
push: true
201209
tags: |
202210
ghcr.io/openimis/openimis-fe:${{ env.TAG_FE }}
203211
cache-from: type=gha,scope=solution-${{ env.LOWER_SOL }}-fe
204-
cache-to: type=gha,mode=max,scope=solution-${{ env.LOWER_SOL }}-fe
212+
cache-to: type=gha,mode=max,scope=solution-${{ env.LOWER_SOL }}-fe
213+
build-args: |
214+
NPM_CONFIG_FETCH_TIMEOUT=600000
215+
NPM_CONFIG_FETCH_RETRY_MINTIMEOUT=30000
216+
NPM_CONFIG_FETCH_RETRY_MAXTIMEOUT=120000

bin/act

20.1 MB
Binary file not shown.

0 commit comments

Comments
 (0)