ci: build arm64 and amd64 container images for ci images (#1036)

This commit is contained in:
ᗪєνιη ᗷυнʟ
2021-03-06 04:50:28 -05:00
committed by GitHub
parent 7aa0239cd9
commit 9966632c64
2 changed files with 10 additions and 0 deletions

View File

@@ -59,6 +59,7 @@ jobs:
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: |
COMMIT_TAG=${{ github.sha }}

View File

@@ -1,11 +1,20 @@
FROM node:14.16-alpine AS BUILD_IMAGE
ARG TARGETPLATFORM
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
ARG COMMIT_TAG
ENV COMMIT_TAG=${COMMIT_TAG}
COPY . /app
WORKDIR /app
RUN \
case "${TARGETPLATFORM}" in \
'linux/arm64') apk add --no-cache python make g++ ;; \
'linux/arm/v7') apk add --no-cache python make g++ ;; \
esac
RUN yarn --frozen-lockfile && \
yarn build