From 6aa7fbf1469a2236355bf520b6fbfd16cbcd5448 Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 2 Feb 2024 16:58:01 +0100 Subject: [PATCH] =?UTF-8?q?try=20something=20out=20with=20docker=20uwu=20?= =?UTF-8?q?=F0=9F=91=89=F0=9F=91=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit should ideally work 🥺 --- .github/workflows/main.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 2 +- Dockerfile | 18 ++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml create mode 100644 Dockerfile diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..984d55b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,28 @@ +name: Build and publish new containers + +on: + push: + branches: [daddy, procens] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: lts/* + - run: npm ci + - run: npm run test + - run: npm run build + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64,linux/arm32,linux/ppc64le,linux/s390x + tags: chrissx/kinkcheck.top:${{ github.ref_name }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c97c75..c100b1c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,5 +8,5 @@ jobs: - uses: actions/setup-node@v4 with: node-version: lts/* - - run: npm install + - run: npm ci - run: npm run test diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f1dc548 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:lts-alpine +ENV NODE_ENV production +WORKDIR /usr/src/app + +# requires buildx/buildkit, which not everything has *yet* +RUN --mount=type=bind,source=package.json,target=package.json \ + --mount=type=bind,source=package-lock.json,target=package-lock.json \ + --mount=type=cache,target=/root/.npm \ + npm ci --omit=dev +#COPY package.json . +#COPY package-lock.json . +#RUN npm ci --omit=dev +#RUN rm package.json package-lock.json + +USER node +COPY dist . +EXPOSE 4321 +CMD node server/entry.mjs