Skip to content

Commit b85036b

Browse files
committed
Dockerfile manual architecture selection for multiplatform build. Disable NPM Publish for testing
1 parent 3b75e13 commit b85036b

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

Diff for: .github/workflows/releases.yml

+13-10
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,22 @@ jobs:
6262
tags: ${{ steps.image-metadata.outputs.tags }}
6363
labels: ${{ steps.image-metadata.outputs.labels }}
6464
containerfiles: ./Dockerfile
65-
platforms: linux/amd64,linux/arm64,linux/arm/v7
65+
archs: amd64,arm64v8,arm32v7
6666
oci: true
67+
# enable build layer caching between platforms
68+
layers: true
6769
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
6870
extra-args: |
6971
--ulimit nofile=10000
7072
73+
- name: Publish to GHCR
74+
uses: redhat-actions/push-to-registry@v2
75+
with:
76+
image: ${{ steps.build-image.outputs.image }}
77+
tags: ${{ steps.build-image.outputs.tags }}
78+
registry: ${{ env.REGISTRY }}
79+
username: ${{ env.REGISTRY_USER }}
80+
password: ${{ env.REGISTRY_PASSWORD }}
7181

7282
- name: Upload Release Assets
7383
id: upload-release-assets
@@ -82,13 +92,6 @@ jobs:
8292

8393
- name: Publish to NPM
8494
uses: JS-DevTools/npm-publish@v1
95+
if: false
8596
with:
86-
token: ${{ secrets.NPM_TOKEN }}
87-
88-
- name: Publish to GHCR
89-
uses: redhat-actions/push-to-registry@v2
90-
with:
91-
tags: ${{ steps.build-image.outputs.tags }}
92-
registry: ${{ env.REGISTRY }}
93-
username: ${{ env.REGISTRY_USER }}
94-
password: ${{ env.REGISTRY_PASSWORD }}
97+
token: ${{ secrets.NPM_TOKEN }}

Diff for: Dockerfile

+8-3
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,24 @@ COPY package.json .
1212
COPY package-lock.json .
1313

1414
# Install dependencies
15-
# --ignore-scripts do not run grunt postinstall script as it depends on files other than package.json
15+
# --ignore-scripts prevents postinstall script (which runs grunt) as it depends on files other than package.json
1616
RUN npm ci --ignore-scripts
1717

18-
# Build the app
18+
# Copy files needed for postinstall and build
1919
COPY . .
2020

2121
# npm postinstall runs grunt, which depends on files other than package.json
2222
RUN npm run postinstall
23+
24+
# Build the app
2325
RUN npm run build
2426

2527
#########################################
2628
# Package static build files into nginx #
2729
#########################################
28-
FROM nginx:stable-alpine AS cyberchef
30+
# We are using Github Actions: redhat-actions/buildah-build@v2 which needs manual selection of arch in base image
31+
# Remove TARGETARCH if docker buildx is supported in the CI release as --platform=$TARGETPLATFORM will be automatically set
32+
ARG TARGETARCH
33+
FROM ${TARGETARCH}/nginx:stable-alpine AS cyberchef
2934

3035
COPY --from=builder /app/build/prod /usr/share/nginx/html/

0 commit comments

Comments
 (0)