Fix arm build (#302)

* WIP.

* WIP.

* WIP.
This commit is contained in:
Miroslav Šedivý 2023-04-29 18:35:11 +02:00 committed by GitHub
parent 92ad202bfe
commit 5959d056f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 57 additions and 18 deletions

View File

@ -32,24 +32,27 @@ RUN ./build
# #
# STAGE 2: CLIENT # STAGE 2: CLIENT
# #
FROM node:18-bullseye-slim as client
# install dependencies
RUN set -eux; apt-get update; \
apt-get install -y --no-install-recommends python2 build-essential
WORKDIR /src
# #
# install dependencies # Because client builds fail in Github Actions, therefor we build it outside of Docker.
COPY client/package*.json ./ #
RUN npm install # FROM node:18-bullseye-slim as client
#
# # install dependencies
# RUN set -eux; apt-get update; \
# apt-get install -y --no-install-recommends python2 build-essential
#
# WORKDIR /src
#
# #
# # install dependencies
# COPY client/package*.json ./
# RUN npm install
#
# #
# # build client
# COPY client/ .
# RUN npm run build
# #
# build client
COPY client/ .
RUN npm run build
# #
# STAGE 3: RUNTIME # STAGE 3: RUNTIME
# #
@ -134,7 +137,8 @@ ENV NEKO_BIND=:8080
# #
# copy static files from previous stages # copy static files from previous stages
COPY --from=server /src/bin/neko /usr/bin/neko COPY --from=server /src/bin/neko /usr/bin/neko
COPY --from=client /src/dist/ /var/www # COPY --from=client /src/dist/ /var/www
COPY client/dist/ /var/www
HEALTHCHECK --interval=10s --timeout=5s --retries=8 \ HEALTHCHECK --interval=10s --timeout=5s --retries=8 \
CMD wget -O - http://localhost:${NEKO_BIND#*:}/health || exit 1 CMD wget -O - http://localhost:${NEKO_BIND#*:}/health || exit 1

View File

@ -13,7 +13,7 @@ env:
PLATFORMS: linux/arm64,linux/arm/v7 PLATFORMS: linux/arm64,linux/arm/v7
jobs: jobs:
build-base: build-client:
runs-on: ubuntu-latest runs-on: ubuntu-latest
# #
# do not run on forks # do not run on forks
@ -23,6 +23,41 @@ jobs:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
-
name: Set up node
uses: actions/setup-node@v3
with:
node-version: 18.x
-
name: Build client
run: |
cd client
npm install
npm run build
-
name: Upload client dist
uses: actions/upload-artifact@v3
with:
name: client-dist
path: client/dist
build-base:
runs-on: ubuntu-latest
#
# do not run on forks
#
if: github.repository_owner == 'm1k1o'
needs: [ build-client ]
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Download client dist
uses: actions/download-artifact@v3
with:
name: client-dist
path: client/dist
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1