Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/node-ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ on:
type: string
description: 'For builds in sub-directories, provide the path. Leave empty for repo root.'
default: ''
platforms:
required: false
type: string
default: ''
description: 'Comma-separated docker target platforms for a multi-arch image, e.g. "linux/amd64,linux/arm64". Empty (default) keeps the current single-arch build on the runner architecture. Use for images that must also run natively on arm64 hosts (e.g. dev/e2e images pulled on Apple Silicon, where emulating JIT-heavy runtimes like workerd/V8 under Rosetta is unreliable).'

permissions:
contents: write
Expand Down Expand Up @@ -180,13 +185,25 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN || secrets.GITHUB_TOKEN }}

# Cross-arch emulation + buildx are only needed for multi-arch builds;
# the default single-arch path stays on the plain docker driver.
- name: Set up QEMU
if: ${{ inputs.platforms != '' }}
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
if: ${{ inputs.platforms != '' }}
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: ${{ inputs.root_path || '.' }}
file: ${{ inputs.root_path && format('{0}/Dockerfile', inputs.root_path) || './Dockerfile' }}
push: true
tags: ghcr.io/${{ env.IMAGE_NAME }}
# empty string = input omitted (single-arch, unchanged behavior)
platforms: ${{ inputs.platforms }}

security-scan:
name: 'Docker Security Scan'
Expand Down