Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions .github/workflows/ambar-task-explorer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

# QEMU registers binfmt handlers so buildx can RUN steps for non-native
# platforms via emulation (we publish linux/amd64 + linux/arm64; the
# runner is amd64, so arm64 RUN steps need QEMU).
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -117,8 +123,13 @@ jobs:
with:
context: ./task-explorer
push: false
# Validate both architectures at PR time so arm64-only build
# failures don't slip through to a post-merge publish.
platforms: linux/amd64,linux/arm64
build-args: |
GITHUB_TOKEN=${{ secrets.READ_ACCESS_TO_REPOS }}
cache-from: type=gha,scope=task-explorer
cache-to: type=gha,mode=max,scope=task-explorer

- name: Extract version
if: github.ref == 'refs/heads/main'
Expand All @@ -131,8 +142,13 @@ jobs:
with:
context: ./task-explorer
push: true
# Multi-arch manifest list — Ambar staging EKS nodes are arm64,
# local dev (Docker Desktop, Linux laptops) is typically amd64.
platforms: linux/amd64,linux/arm64
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.value }}
build-args: |
GITHUB_TOKEN=${{ secrets.READ_ACCESS_TO_REPOS }}
cache-from: type=gha,scope=task-explorer
cache-to: type=gha,mode=max,scope=task-explorer
9 changes: 7 additions & 2 deletions task-explorer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
FROM node:24.0.0-alpine AS frontend-builder
# TARGETPLATFORM is set automatically by buildx (e.g. "linux/amd64",
# "linux/arm64"). We thread it into the pnpm-store cache id so each platform
# gets its own cache namespace under multi-arch builds.
ARG TARGETPLATFORM
WORKDIR /app/frontend

RUN apk add --no-cache git
Expand All @@ -11,7 +15,7 @@ RUN : "${GITHUB_TOKEN:?Required build argument GITHUB_TOKEN not set}"

COPY ./frontend/package.json ./package.json
COPY ./.npmrc ./.npmrc
RUN --mount=type=cache,id=pnpm-store-arm64,target=/root/.local/share/pnpm/store pnpm install
RUN --mount=type=cache,id=pnpm-store-${TARGETPLATFORM},target=/root/.local/share/pnpm/store pnpm install

COPY ./frontend/src ./src
COPY ./frontend/public ./public
Expand All @@ -22,6 +26,7 @@ ENV VITE_BASE_PATH=${VITE_BASE_PATH}
RUN pnpm run build

FROM node:24.0.0-alpine AS backend-builder
ARG TARGETPLATFORM
WORKDIR /app/backend

RUN apk add --no-cache git
Expand All @@ -34,7 +39,7 @@ RUN : "${GITHUB_TOKEN:?Required build argument GITHUB_TOKEN not set}"

COPY ./backend/package.json ./package.json
COPY ./.npmrc ./.npmrc
RUN --mount=type=cache,id=pnpm-store-arm64,target=/root/.local/share/pnpm/store pnpm install
RUN --mount=type=cache,id=pnpm-store-${TARGETPLATFORM},target=/root/.local/share/pnpm/store pnpm install

COPY ./backend/src ./src
COPY ./backend/tests ./tests
Expand Down
2 changes: 1 addition & 1 deletion task-explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "task-explorer",
"private": true,
"version": "0.1.0",
"version": "0.1.1",
"scripts": {
"dev:frontend": "pnpm --filter './frontend' dev -- --host 0.0.0.0",
"dev:api": "pnpm --filter './backend' dev",
Expand Down
Loading