Fix Github Release CI (#144)

* fix: attempt fix from https://github.com/reproducible-containers/buildkit-cache-dance

* fix: lint

* fix: migrate to pnpm to see if it builds

* fix: comment out unified deps builder

* fix: remove dependency on deps

* fix: shamefully hoist deps
This commit is contained in:
DecDuck
2025-07-31 21:36:01 +10:00
committed by GitHub
parent 244f20b5f4
commit 4e901164fb
5 changed files with 36 additions and 16 deletions

View File

@ -23,6 +23,7 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
submodules: true submodules: true
fetch-depth: 1 # fix for when this gets triggered by tag
fetch-tags: true fetch-tags: true
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
@ -78,6 +79,21 @@ jobs:
# set latest tag for stable releases # set latest tag for stable releases
type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.prerelease == false }} type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.release.prerelease == false }}
- name: Cache
uses: actions/cache@v4
id: cache
with:
path: cache-mount
key: cache-mount-${{ hashFiles('Dockerfile') }}
- name: Restore Docker cache mounts
uses: reproducible-containers/buildkit-cache-dance@v3
with:
builder: ${{ steps.setup-buildx.outputs.name }}
cache-dir: cache-mount
dockerfile: Dockerfile
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Build and push image - name: Build and push image
id: build-and-push id: build-and-push
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6

View File

@ -1,42 +1,47 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
# Unified deps builder ### Unified deps builder
FROM node:lts-alpine AS deps # FROM node:lts-alpine AS deps
WORKDIR /app # WORKDIR /app
COPY package.json yarn.lock ./ # COPY package.json yarn.lock ./
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --network-timeout 1000000 --ignore-scripts # RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn install --network-timeout 1000000 --ignore-scripts
# Build for app ### Build for app
FROM node:lts-alpine AS build-system FROM node:lts-alpine AS build-system
# setup workdir - has to be the same filepath as app because fuckin' Prisma # setup workdir - has to be the same filepath as app because fuckin' Prisma
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV NUXT_TELEMETRY_DISABLED=1 ENV NUXT_TELEMETRY_DISABLED=1
ENV YARN_CACHE_FOLDER=/root/.yarn # ENV YARN_CACHE_FOLDER=/root/.yarn
# add git so drop can determine its git ref at build # add git so drop can determine its git ref at build
RUN apk add --no-cache git # pnpm for build
RUN apk add --no-cache git pnpm
# copy deps and rest of project files # copy deps and rest of project files
COPY --from=deps /app/node_modules ./node_modules # COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
ARG BUILD_DROP_VERSION ARG BUILD_DROP_VERSION
ARG BUILD_GIT_REF ARG BUILD_GIT_REF
# build # build
RUN --mount=type=cache,target=/root/.yarn yarn postinstall && \ RUN pnpm import
yarn build RUN pnpm install --shamefully-hoist
RUN pnpm run build
# RUN --mount=type=cache,target=/root/.yarn yarn postinstall && yarn build
# create run environment for Drop ### create run environment for Drop
FROM node:lts-alpine AS run-system FROM node:lts-alpine AS run-system
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV NUXT_TELEMETRY_DISABLED=1 ENV NUXT_TELEMETRY_DISABLED=1
RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn add --network-timeout 1000000 --no-lockfile --ignore-scripts prisma@6.11.1 # RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn yarn add --network-timeout 1000000 --no-lockfile --ignore-scripts prisma@6.11.1
RUN apk add --no-cache pnpm
RUN pnpm install prisma@6.11.1
COPY --from=build-system /app/package.json ./ COPY --from=build-system /app/package.json ./
COPY --from=build-system /app/.output ./app COPY --from=build-system /app/.output ./app

View File

@ -2,7 +2,7 @@
# This file starts up the Drop server by running migrations and then starting the executable # This file starts up the Drop server by running migrations and then starting the executable
echo "[Drop] performing migrations..." echo "[Drop] performing migrations..."
yarn prisma migrate deploy pnpm prisma migrate deploy
# Actually start the application # Actually start the application
node /app/app/server/index.mjs node /app/app/server/index.mjs

View File

@ -79,7 +79,6 @@
"typescript": "^5.8.3", "typescript": "^5.8.3",
"vue-tsc": "^3.0.1" "vue-tsc": "^3.0.1"
}, },
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e",
"overrides": { "overrides": {
"vue3-carousel-nuxt": { "vue3-carousel-nuxt": {
"vue3-carousel": "^0.16.0" "vue3-carousel": "^0.16.0"

View File

@ -2898,7 +2898,7 @@
resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.18.tgz#529f24a88d3ed678d50fd5c07455841fbe8ac95e" resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.5.18.tgz#529f24a88d3ed678d50fd5c07455841fbe8ac95e"
integrity sha512-cZy8Dq+uuIXbxCZpuLd2GJdeSO/lIzIspC2WtkqIpje5QyFbvLaI5wZtdUjLHjGZrlVX6GilejatWwVYYRc8tA== integrity sha512-cZy8Dq+uuIXbxCZpuLd2GJdeSO/lIzIspC2WtkqIpje5QyFbvLaI5wZtdUjLHjGZrlVX6GilejatWwVYYRc8tA==
"@vueuse/core@13.6.0": "@vueuse/core@13.6.0", "@vueuse/core@^13.6.0":
version "13.6.0" version "13.6.0"
resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-13.6.0.tgz#4137f63dc4cef2ff8ae74ee146d6b6070d707878" resolved "https://registry.yarnpkg.com/@vueuse/core/-/core-13.6.0.tgz#4137f63dc4cef2ff8ae74ee146d6b6070d707878"
integrity sha512-DJbD5fV86muVmBgS9QQPddVX7d9hWYswzlf4bIyUD2dj8GC46R1uNClZhVAmsdVts4xb2jwp1PbpuiA50Qee1A== integrity sha512-DJbD5fV86muVmBgS9QQPddVX7d9hWYswzlf4bIyUD2dj8GC46R1uNClZhVAmsdVts4xb2jwp1PbpuiA50Qee1A==