reload on commit should work now?
This commit is contained in:
parent
74773ccd15
commit
33f498af70
2 changed files with 11 additions and 16 deletions
19
Dockerfile
19
Dockerfile
|
@ -1,22 +1,9 @@
|
||||||
FROM node:lts-alpine AS base
|
FROM node:lts-alpine AS base
|
||||||
RUN npm i -g pnpm
|
RUN npm i -g pnpm && \
|
||||||
|
apk add git
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json pnpm-lock.yaml ./
|
|
||||||
|
|
||||||
FROM base as prod-deps
|
|
||||||
RUN pnpm install -P
|
|
||||||
|
|
||||||
FROM base as build-deps
|
|
||||||
RUN pnpm install
|
|
||||||
|
|
||||||
FROM build-deps as build
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm run build
|
RUN pnpm install && pnpm build
|
||||||
|
|
||||||
|
|
||||||
FROM base as runtime
|
|
||||||
COPY --from=prod-deps /app/node_modules .
|
|
||||||
COPY --from=build /app/dist ./dist
|
|
||||||
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV PORT=4321
|
ENV PORT=4321
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
import { exec } from "node:child_process";
|
||||||
|
import util from "node:util";
|
||||||
|
const exec_promise = util.promisify(exec);
|
||||||
export async function POST({ params, request }) {
|
export async function POST({ params, request }) {
|
||||||
console.log(params, request);
|
console.log(params, request);
|
||||||
|
let result = await exec_promise("git pull && pnpm build").then((out, err) => {
|
||||||
|
return { out, err };
|
||||||
|
});
|
||||||
|
console.log("Outside", result);
|
||||||
|
return new Response(JSON.stringify(result));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue